Click here to Skip to main content
15,882,464 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionVS.NET 2005 & VS.NET 2003 - can they co-exist safely? Pin
code_wiz5-Nov-05 9:59
code_wiz5-Nov-05 9:59 
AnswerRe: VS.NET 2005 & VS.NET 2003 - can they co-exist safely? Pin
Kevin McFarlane6-Nov-05 4:32
Kevin McFarlane6-Nov-05 4:32 
QuestionImplementing developers API, a question about access control... Pin
Member 965-Nov-05 5:57
Member 965-Nov-05 5:57 
QuestionTrain free @Microsoft Pin
vikas amin4-Nov-05 22:57
vikas amin4-Nov-05 22:57 
Questionhow to get the parent data Pin
sheerprogrammer4-Nov-05 20:25
sheerprogrammer4-Nov-05 20:25 
AnswerRe: how to get the parent data Pin
S. Senthil Kumar4-Nov-05 21:49
S. Senthil Kumar4-Nov-05 21:49 
GeneralRe: how to get the parent data Pin
sheerprogrammer5-Nov-05 4:29
sheerprogrammer5-Nov-05 4:29 
AnswerRe: how to get the parent data Pin
Member 965-Nov-05 6:04
Member 965-Nov-05 6:04 
Think about it the other way around, put a public property in your child form that is set by the parent form when the child form is constructed. The property could reference whatever you like, so let's say you have a text box in your parent form, you can have a public property in your child form like this:

private TextBox _parentTextBox=null;<br />
public TextBox ParentTextBox<br />
{<br />
  set{ _parentTextBox=value;}<br />
}


When you create your child from from your parent form, set it's "ParentTextBox" property to your parent forms corresponding text box and you now have full access to it.

Of course it doesn't have to be a text box, it could be any object in your parent form and it doesn't have to be a property, you could just make it a parameter in the constructor of your child form depending on how required or not it is.

This is much clearer and more portable than trying to cast the parent form to gain access to it and easier to ensure there are no problems down the road with changes etc.



"Hello, hello, what's all this shouting, we'll have no trouble here! This is a Local Shop for Local People, there's nothing for you here!"
-Edward Tattsyrup
GeneralRe: how to get the parent data Pin
sheerprogrammer5-Nov-05 17:47
sheerprogrammer5-Nov-05 17:47 
Question.Net 1.1 question Pin
Stanciu Vlad4-Nov-05 11:12
Stanciu Vlad4-Nov-05 11:12 
AnswerRe: .Net 1.1 question Pin
S. Senthil Kumar4-Nov-05 21:52
S. Senthil Kumar4-Nov-05 21:52 
GeneralRe: .Net 1.1 question Pin
Stanciu Vlad5-Nov-05 6:14
Stanciu Vlad5-Nov-05 6:14 
GeneralRe: .Net 1.1 question Pin
Kevin McFarlane6-Nov-05 4:35
Kevin McFarlane6-Nov-05 4:35 
QuestionSerializing BindingList Pin
Larry R. Weinheimer4-Nov-05 8:23
Larry R. Weinheimer4-Nov-05 8:23 
AnswerRe: Serializing BindingList Pin
Larry R. Weinheimer4-Nov-05 11:57
Larry R. Weinheimer4-Nov-05 11:57 
Questionlinker errors porting from .NET 1.1 to 2.0 Pin
chucker754-Nov-05 2:30
chucker754-Nov-05 2:30 
QuestionVS 2003 IDE issue Pin
matthias s.4-Nov-05 1:56
matthias s.4-Nov-05 1:56 
QuestionUrlEditor doesn't display in design time Pin
smoitry3-Nov-05 22:50
smoitry3-Nov-05 22:50 
Questionfile monitoring low level Pin
UgoDeschamps3-Nov-05 6:40
UgoDeschamps3-Nov-05 6:40 
AnswerRe: file monitoring low level Pin
Dave Kreskowiak3-Nov-05 14:05
mveDave Kreskowiak3-Nov-05 14:05 
QuestionInsert Line of Text in Text File Pin
Rabbit173-Nov-05 6:08
Rabbit173-Nov-05 6:08 
AnswerRe: Insert Line of Text in Text File Pin
Rabbit173-Nov-05 7:31
Rabbit173-Nov-05 7:31 
GeneralRe: Insert Line of Text in Text File Pin
Dave Kreskowiak3-Nov-05 14:03
mveDave Kreskowiak3-Nov-05 14:03 
Question.NET Threads taking CPU time while suspended Pin
khariv2-Nov-05 22:58
khariv2-Nov-05 22:58 
AnswerRe: .NET Threads taking CPU time while suspended Pin
akyriako782-Nov-05 23:56
akyriako782-Nov-05 23:56 

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.