Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 107,695 VB.NET Programmers for FREE! Ask your question and get quick answers from experts. There are 1,091 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



using variables from one class in another

 
Reply to this topicStart new topic

using variables from one class in another

keithmoloney
post 3 Jul, 2008 - 07:45 AM
Post #1


New D.I.C Head

*
Joined: 4 Apr, 2008
Posts: 33


My Contributions


i have a form called PanelDlg.vb. on this form there is an option button called AltiumSelect.

in a different class, Autoplace.vb, it will not allow me to call PanelDlg.AltiumSelect, so i call VicApp.AltiumSelect

i have the code......

CODE

if VicApp.AltiumSelect.Checked = True Then
.........
..........


this isnt working because when AltiumSelect is checked, it still returns false.
can anyone tell me why i cannot call PanelDlg.AltiumSelect and must use VicApp.AltiumSelect instead?
also why is it returning false even though the statement is true?
User is offlineProfile CardPM

Go to the top of the page


nofear217
post 3 Jul, 2008 - 08:19 AM
Post #2


D.I.C Head

Group Icon
Joined: 8 Nov, 2007
Posts: 122



Dream Kudos: 175
My Contributions


It would depend on how you have the variable declared in PanelDlg.vb....if it is set to private then you will not be able to access the control/variable. Another way to access it might be to fully qualify it using the namespace.class.variable though visibility will still come into play.

If the two classes are within the same project/assembly then you could set the variable to protected friend rather than private.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/30/08 01:20AM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month