Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Useing Class structures and Events
I have created a class of textbox objects on a form with the following code;
Dim Listings() As New Class1 Dim listcount As Integer Dim ctl As Control listcount = 0 For Each ctl In Tag_Priority.Controls If TypeName(ctl) = "TextBox" And ctl.Visible = True Then listcount = listcount + 1 ReDim Preserve Listings(1 To listcount) Set Listings(listcount).listgroup = ctl End If Next ctl Class Module - Public WithEvents listgroup As MSForms.TextBox Private Sub listgroup_Change() Bla Bla Bla End sub The problem is that the Change() event triggers each time a single digit is modified in the included textboxs. It works great for my Bla Bla Bla code when my textbox.text inputs are single digits 1,2,3, etc. but is a disaster when I want to enter double digit numbers like 11,12,13, etc., each number is its own textbox. I was hoping there is an event trigger or something I could use that would trigger when I select another object either in that class or on that form. The form presents a list with associated priorities as texboxes, the idea is that the user can change the textbox value which will then reprioritize the list based on the new individual textbox inputs. Im using Office 2000, I would apriciate any help that could be offered, Im twisting my brain up in knots with logic statements. Thanks, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Useing Class structures and Events
Hi Dan,
The form presents a list with associated priorities as texboxes, the idea is that the user can change the textbox value which will then reprioritize the list based on the new individual textbox inputs. Two potential alternatives come to mind: 1. Instead of reacting to the change event, have a separate 'Resort list' button to do the reprioritisation. 2. Add a timer to the form (e.g. the IETimer.ocx available from the MS web site), set to fire after (say) three seconds. Each time a text box is changed, disable and reenable the timer. In the timer's event, reprioritize the list then disable the timer again. The list should then update 'automagically' three seconds after you stop typing. Regards Stephen Bullen Microsoft MVP - Excel www.oaltd.co.uk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I draw chemical structures in Excel spreed sheet? | Charts and Charting in Excel | |||
Importing File Structures to Excel | Excel Discussion (Misc queries) | |||
class events stop firing with ADO 2.8 | Excel Programming | |||
Events, Class, Time Editing | Excel Programming | |||
What events can be captured in a Class Module? | Excel Programming |