|
-
Oct 13th, 2000, 08:47 AM
#1
Thread Starter
Addicted Member
Anyone know the syntax for calling a click on an item in a list box... IE I have 3 names in a listbox, I click on one of em, and I want it to open another form, and pass the info from that list item to the new form.
-
Oct 13th, 2000, 08:55 AM
#2
Frenzied Member
In form1:
Code:
Dim X As Integer
Private Sub Form_Load()
For X = 0 To 15
List1.AddItem X
Next X
End Sub
Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form2.Info = List1.Text
Form2.Show
End Sub
In form2:
Code:
Option Explicit
Public Info As String
Private Sub Form_Load()
MsgBox Info
End Sub
Hope that helped!
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 13th, 2000, 08:57 AM
#3
_______
<?>
Use the click event of the listbox
'
Form2.Show
Form2.Text1.text = Form1.List1.Text
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 13th, 2000, 09:01 AM
#4
_______
<?>
Jop 
A friendly word of advice... you should never use Public varaiables unless there is no other way around things.....and that according to Microsoft
Later:
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 13th, 2000, 09:14 AM
#5
If you right click the listbox, you get a menu box. by selecting "View Code" you will get (at least I get) a new subroutine.
Private Sub boxname_click()
You put your code in here. Whenever anything in boxname is selected (I assume this is a single select, I don't know what happens in multi-select) the mouse click event is fired.
At least, that's the way it ACTS.
Good Luck
DerFarm
-
Oct 13th, 2000, 09:19 AM
#6
Frenzied Member
HeSaidJoe, I have to use a public variable right? how do I pass the info the variable then?? yeah you're right, I can pass it to a textbox first hehe that's better, but doesn't the textbox takes up memory then?
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 13th, 2000, 09:39 AM
#7
transcendental analytic
Why don't you use public variables in a standard module, then the form2 will read from the module
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 13th, 2000, 10:04 AM
#8
_______
<?>
Job, you are right...I should wear my glasses..I thought he was posting the information into a textbox.
Being as he has to pass it to something, if it's a control, use the control (textbox or whatever) and if a var then it should be a public var in a module.
My error! Sorry...I guess this is a time for a public var.
Wayne
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
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
|