|
-
Jan 26th, 2004, 08:03 AM
#1
Thread Starter
Member
Control Array and Other Issues
Hi mates,
Hope you are alright,
I've got a few questions, related to vb .net
I've managed while running the program to create buttons, panels, textboxts, and adjust their properties such as colour, height, ..... etc
but the question is, if i want to give some actions to the new buttons like click on it, or mouse hovering , or mouse leave,
how can i do that, saying everytime i clicked on that new buttons, i run the same function, which for example display another form
p.s. i want the same job for each new button,
can we use, four , and three dimensions arrays........
Another problem:
================
i am trying to build a hierarchy network using vb .net
so i've got data on level zero, subdata on level one, subsub data on level two.....
i am trying to start by first node or label at the top or level zero,,,,
then create new buttons or layers at level one,,,,,,,,
saying we create the whole hierarchy,
when runing the program next time, i loose all info... and i have to enter the data all over again...
what's the best way to do things, shall i store how data are linked into a database or several arrays,,,,
or sall i replay new buttons, whihc represents nodes in levels, with labelsss.
thanks very much for your help
-
Jan 26th, 2004, 08:10 AM
#2
Hi.
Regarding your buttons.
If you are creating the buttons dynamically you can add a eventhandler for them.
VB Code:
'***
'In whatever sub you like...
Dim B as New Button
Addhandler(B.Click, AddressOf MyClickEvent)
'***
Private Sub MyClickEvent(Byval sender as Object, e as EventArgs)
'Handle buttoncode here.
End Sub
If you dynamically remove the buttons later, you should call the RemoveHandler function to free up resources.
If you don't and then re-create the buttons later, you will must likely have a lot of handlers, with lost references.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
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
|