Results 1 to 2 of 2

Thread: Control Array and Other Issues

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Location
    UK
    Posts
    43

    Question 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

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    Regarding your buttons.

    If you are creating the buttons dynamically you can add a eventhandler for them.

    VB Code:
    1. '***
    2. 'In whatever sub you like...
    3. Dim B as New Button
    4. Addhandler(B.Click, AddressOf MyClickEvent)
    5. '***
    6.  
    7. Private Sub MyClickEvent(Byval sender as Object, e as EventArgs)
    8.   'Handle buttoncode here.
    9. 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
  •  



Click Here to Expand Forum to Full Width