control array again

anomaly
09-28-2001, 05:00 PM
ok now that I get the array to work kinda the way I want, is there anywhere I can go to learn how to make the controls acually DO something? :O) thanks people. later

Ok....it's basically visual, what about the rest?

orufet
09-28-2001, 05:06 PM
What sort of control array do you have? What kind of controls are they? Are you familiar with the VB IDE? Do you know how to add code to a standard control?

"I do not agree with a word you say, but I will defend to the death your right to say it" - Voltaire

JDT
09-28-2001, 05:10 PM
You can use the Index property of the Events associated with the control array to determine which one triggered the event.

Try this with an array of command buttons.

<pre><font color=blue>Option Explicit</font color=blue>

<font color=blue>Private Sub</font color=blue> Command1_Click(Index <font color=blue>As Integer</font color=blue>)

MsgBox "You clicked Command " & <font color=blue>CStr</font color=blue>(Index), , ""

<font color=blue>End Sub</font color=blue></pre>

JDT

anomaly
09-29-2001, 07:39 AM
ok, im using graphical checkboxes for my buttons, when someone selects to open a new window from my dropdown menu I want it to create a button with the same caption as the window (the button itself will only show and hide the window which I can fix either because of the same problem ) heres what I have so far though ......

Private Sub Mnuchat_Click()

Dim ButtonName As String, mnuName As Menu
Dim i As Integer, x As Integer

For i = 1 To 1
x = Check1.Count
Load Check1(x)
Check1(x).Left = Check1(x - 1).Left + Check1(x - 1).Width * 1.2
Check1(x).Visible = True

If mnuName.Caption = "Chat" Then
ButtonName = mnuName.Caption
ElseIf mnuName.Caption = "Advertise" Then
ButtonName = mnuName.Caption
End If

Check1(x).Caption = ButtonName

Next i

End Sub

Ok....it's basically visual, what about the rest?

anomaly
09-29-2001, 11:12 AM
thanks for the help people I finally got it to work heh.

Ok....it's basically visual, what about the rest?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum