Click here to Skip to main content
15,913,773 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to refer to a control from inside a class? Pin
IlanTal9-Aug-06 0:17
IlanTal9-Aug-06 0:17 
GeneralRe: How to refer to a control from inside a class? Pin
IlanTal9-Aug-06 0:28
IlanTal9-Aug-06 0:28 
GeneralRe: How to refer to a control from inside a class? Pin
Guffa9-Aug-06 2:08
Guffa9-Aug-06 2:08 
GeneralRe: How to refer to a control from inside a class? Pin
IlanTal9-Aug-06 3:11
IlanTal9-Aug-06 3:11 
GeneralRe: How to refer to a control from inside a class? Pin
Leah_Garrett9-Aug-06 4:31
Leah_Garrett9-Aug-06 4:31 
GeneralRe: How to refer to a control from inside a class? Pin
Dave Kreskowiak9-Aug-06 4:52
mveDave Kreskowiak9-Aug-06 4:52 
GeneralRe: How to refer to a control from inside a class? Pin
IlanTal9-Aug-06 19:16
IlanTal9-Aug-06 19:16 
GeneralRe: How to refer to a control from inside a class? Pin
Guffa9-Aug-06 23:41
Guffa9-Aug-06 23:41 
IlanTal wrote:
I think you got slightly confused as to who changes who.
I want the function to change the form.


No, I'm not confused about that.

IlanTal wrote:
It doesn't recognize 'this', but on the other hand it knows what 'Me' is. Likewise it doesn't know what 'Form1 mainForm' is but it does know what 'ByRef mainForm As Form1' is.


Right. I'm only programming C# myself, so I mixed up the syntax a bit. Sorry for that.

There is no reason to specify ByRef for the reference, though. You are not going to replace the main form with a completeley new form in the method, are you?

IlanTal wrote:
Do you know if I could save the value of mainForm in my class in case I need it outside of the Init function? I could make it a class variable, but the question is if it could change? My gut feeling is that it wouldn't change since it is the main form.


Yes, you could. The reference to the main form won't change as long as the form is open.

However, as I suggested before, I reccommend that you just send a reference to the control that the method is going to change. That way it's obvious what the method is going to update, and as the method isn't locked to a specific control you might be able to use the method for more than one control.


---
b { font-weight: normal; }

Questionhow to show detail on list view? Pin
campbells8-Aug-06 17:42
campbells8-Aug-06 17:42 
AnswerRe: how to show detail on list view? Pin
Rizwan Bashir8-Aug-06 21:16
Rizwan Bashir8-Aug-06 21:16 
GeneralRe: how to show detail on list view? Pin
campbells8-Aug-06 21:31
campbells8-Aug-06 21:31 
QuestionCustom Control Datasource Pin
Thomas Wells8-Aug-06 12:11
Thomas Wells8-Aug-06 12:11 
AnswerRe: Custom Control Datasource Pin
Thomas Wells8-Aug-06 12:58
Thomas Wells8-Aug-06 12:58 
QuestionGetting xml from webservice into dataset Pin
digsy_8-Aug-06 10:54
digsy_8-Aug-06 10:54 
AnswerRe: Getting xml from webservice into dataset [modified] Pin
Keith Malwitz8-Aug-06 18:01
Keith Malwitz8-Aug-06 18:01 
GeneralRe: Getting xml from webservice into dataset Pin
digsy_9-Aug-06 1:51
digsy_9-Aug-06 1:51 
GeneralRe: Getting xml from webservice into dataset Pin
digsy_9-Aug-06 2:57
digsy_9-Aug-06 2:57 
Questionclick event Pin
iramg8-Aug-06 9:23
iramg8-Aug-06 9:23 
AnswerRe: click event Pin
Stephen McGuire8-Aug-06 12:21
Stephen McGuire8-Aug-06 12:21 
AnswerRe: click event Pin
Dave Kreskowiak8-Aug-06 16:25
mveDave Kreskowiak8-Aug-06 16:25 
AnswerRe: click event Pin
Guerven8-Aug-06 17:10
Guerven8-Aug-06 17:10 
QuestionGlobal Arrays Pin
peterzorbas8-Aug-06 6:20
peterzorbas8-Aug-06 6:20 
AnswerRe: Global Arrays Pin
peterzorbas8-Aug-06 7:06
peterzorbas8-Aug-06 7:06 
QuestionHow to put checkbox in datagrid through DataGridColoumnStyle. Pin
indiaone8-Aug-06 3:38
indiaone8-Aug-06 3:38 
AnswerRe: How to put checkbox in datagrid through DataGridColoumnStyle. Pin
Stephen McGuire8-Aug-06 7:45
Stephen McGuire8-Aug-06 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.