|
-
August 27th, 2003, 11:08 PM
#1
creating controls
Here is my code:
Dim WithEvents kk As TextBox
Private Sub Form_Load()
For i = 0 To 5
Set kk = Controls.Add("vb.textbox", "Doug" & i)
kk.Width = 1200
kk.Top = 2500 + i * 300
kk.Left = 600
kk.Height = 285
kk.Text = kk.Name '--> doug
kk.Visible = True
Next i
End Sub
Private Sub kk_click()
MsgBox "Thanks for the help", , "hmm"
End Sub
ok; what i can do is create controlls and then modify their contents(text,position etc) after they have been created. What i can not do is raiseEvents with the newly created controls. what i would like to do is on _click (or change etc) have that control execute code. Which would be the same as having an array of text1(0)..text1(5) then on
text1_click(index as integer)
'do whatever
end sub
if you were to copt my code into a from you would see that when you click on the last text box you get a messassage but the other textboxes are 'inactive' --> i want to change this so they will all execuate the same code.
Someone told me that i need to add each control i created to a class and then do some stuff, but i don't have any knowledge of this.
If this is unclear in any way let me know.
- i know i posted this before - but i'm in dire need of this to work pls forgive.
Thanks
-Doug
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|