By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

Control array in vb.net

P: n/a
Please show me
Control array in vb.net

Thanks
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a


Nov 20 '05 #2

P: n/a
Thar Aint Nairn
you add "ControlName.EventName" in a comma-separated list after the word
"Handles" to get similar functionality for event handling - but -

I miss it too

"samean" <sa******@hellogsm.com.kh> wrote in message
news:70****************************@phx.gbl...
Please show me
Control array in vb.net

Thanks

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/29/2004
Nov 20 '05 #3

P: n/a
Thar Aint Nairn
you add "ControlName.EventName" in a comma-separated list after the word
"Handles" to get similar functionality for event handling - but -

I miss it too

"samean" <sa******@hellogsm.com.kh> wrote in message
news:70****************************@phx.gbl...
Please show me
Control array in vb.net

Thanks

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/29/2004
Nov 20 '05 #4

P: n/a
Yes thank you very much,and how about dragdrop event in control array ?
before is Control_DragDrop(index source...)...

Kindly regards,


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #5

P: n/a
Po,
Yes thank you very much,and how about dragdrop event in control array ?
before is Control_DragDrop(index source...)...


I pasted this in the other thread however the discussion did disapeared
them.

The event you take is not important, a trick using this is, make first one
event using the designer for one control and use than one of these 2 methods
for adding handlers to control events.

You have a lot of more possibilities using the control collections (arrays)
it would be endless to write them all.

I hope that one of those helps you?

Cor

Using a self made table
\\\ needs two buttons and a label on a form
Dim btnArea As Button() = New Button() {Button1, Button2}
For Each btn As Button In btnArea
AddHandler btn.MouseLeave, AddressOf Button_MouseLeave
Next
Private Sub Button_MouseEnter(ByVal sender As Object, _
ByVal e As System.EventArgs)
Me.Label1.Text = DirectCast(sender, Button).Name
End Sub
///
And the one I like the most using control.collection
\\\
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
doset(Me)
End Sub
Private Sub doSet(ByVal parentCtr As Control)
Dim ctr As Control
For Each ctr In parentCtr.Controls
AddHandler ctr.LostFocus, AddressOf meLostFocus
AddHandler ctr.GotFocus, AddressOf meGotFocus
doSet(ctr)
Next
End Sub
Private Sub meLostFocus(ByVal sender As Object, _
ByVal e As System.EventArgs)
last = DirectCast(sender, Control).Name
End Sub
Private Sub meGotFocus(ByVal sender As Object, _
ByVal e As System.EventArgs)
DirectCast(sender, Control).Text = last
End Sub
///

Nov 20 '05 #6

P: n/a

Yes thank you very much,I hop see again,
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.