if anybody is interested, here is the code i used (based on a code someone else provided)
created a separate class module named clsHandler with the following code...
Public WithEvents m_TextBox As TextBox
Private Sub m_TextBox_GotFocus()
Call GotTextBoxFocus(m_TextBox)
End Sub
then created the following 2 public subs in a code module...
Public Sub GotTextBoxFocus(ByRef txtBox As TextBox)
txtBox.SelStart = 0
txtBox.SelLength = Len(txtBox.Text)
End Sub
Public Sub InitGotTextBoxFocus(frmForm As Form)
Dim ctrl As Control
Dim newHandler As clsHandler
For Each ctrl In frmForm.Controls
If TypeName(ctrl) = "TextBox" Then
Set newHandler = New clsHandler
Set newHandler.m_TextBox = ctrl
arrHandler.Add newHandler
End If
Next ctrl
End Sub
then i call the InitGotTextBoxFocus sub from load event of each form passing the form as a param...
hmm... well, no way i'm creating a control array... i have some 100 text boxes already setup with descriptive names and 1000s of lines of code... turning them into control array is just too much hastle...
hmm... hold on...
when a text box gets the focus in the application, written in vb6, the text inside needs to be selected... it's very easy task to do... but... i have some 100 of them, if not more... and don't want to be writing an event for every single one of them... (even if that's just a one-line coding per event)
is there any way to write an event and run it for all the text box controls in the project?
thanks
i didn't calculate 500 vs 2000, but for x/2 semi-anually vb x anually...
basically, by the end of the year, your salary is the same, but during the second half of the year you have been paid with x/2 raise...