Click here to Skip to main content
15,889,526 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai to all,

I am developing one vb application . In that i am using Serialport in Button1_Click Event. But now i want to use the same serialport in Button2_Click event.....
Plz help me

Thanks in ADV.....
Posted
Updated 15-Dec-11 0:52am
v3
Comments
Smithers-Jones 15-Dec-11 5:42am    
"Itz" not urgent.

1 solution

Move the declaration of the SerialPort Variable outside the Button1 event handler. If it is a class level (i.e. within the form) then both button handlers in the same form can access it.
 
Share this answer
 
Comments
Himachandra 15-Dec-11 6:51am    
Yahh.... I get it........
Thank U

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900