944,159 Members | Top Members by Rank

Ad:
Nov 10th, 2009
0

Adding code to form using code

Expand Post »
i need to add code to the form using code like the
Controls.Add().

but to add code not a control.

any ideas.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
drabsch is offline Offline
35 posts
since Aug 2009
Nov 10th, 2009
0
Re: Adding code to form using code
plz more clear.
Reputation Points: 14
Solved Threads: 78
Practically a Posting Shark
abu taher is offline Offline
835 posts
since Jul 2008
Nov 11th, 2009
0
Re: Adding code to form using code
ok well i am making a loop that gets all the drives in a drive box and inserts a picbox and a label for each one.

because there can be a different a number of drives i want to add some code that will insert code (for when the label or picbox is clicked) in the loop
Last edited by drabsch; Nov 11th, 2009 at 12:06 am.
Reputation Points: 10
Solved Threads: 0
Light Poster
drabsch is offline Offline
35 posts
since Aug 2009
Nov 11th, 2009
0
Re: Adding code to form using code
you will add a code during runtime? I don't know it its possible but to make a work around on that... make a code/function that will be soon called of the control you will be going to add. You can try the AddHandler() method. Well I don't know it there's a AddHandler() method in VB6.
Reputation Points: 11
Solved Threads: 49
Posting Whiz
jireh is offline Offline
316 posts
since Jul 2007
Nov 11th, 2009
0
Re: Adding code to form using code
ok thanks ill have a look at that

if there are any other ideas let me know
Reputation Points: 10
Solved Threads: 0
Light Poster
drabsch is offline Offline
35 posts
since Aug 2009
Nov 11th, 2009
0
Re: Adding code to form using code
Why not just use the DriveListBox???
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Nov 12th, 2009
0
Re: Adding code to form using code
because the program im making is to be like a sidebar but with all the drives instead of the gadgets.

and the list box is at the top and already opens the drive when i select one
Reputation Points: 10
Solved Threads: 0
Light Poster
drabsch is offline Offline
35 posts
since Aug 2009
Nov 12th, 2009
0
Re: Adding code to form using code
And??? I'm still not understanding but good luck anyways...
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
vb5prgrmr is offline Offline
1,670 posts
since Mar 2009
Nov 15th, 2009
0
Re: Adding code to form using code
ok i think i get it: make your picture box as an array, picture1(0), picture1(1) etc., then use this code
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Load picture1(index)
then you can specify the location with
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. picture1(index).top = ...
i hope this helps!
Reputation Points: 8
Solved Threads: 3
Junior Poster in Training
crackerjacker is offline Offline
53 posts
since Sep 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Vb calculator to work with keypad
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: generate numbers





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC