Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
QuestionTwo Dimensional Control Array? Pin
ehollar4-Sep-05 15:15
ehollar4-Sep-05 15:15 
AnswerRe: Two Dimensional Control Array? Pin
Mohamad Al Husseiny4-Sep-05 15:30
Mohamad Al Husseiny4-Sep-05 15:30 
Questionhow to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 14:45
monica2k4-Sep-05 14:45 
AnswerRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 14:53
protectorChristian Graus4-Sep-05 14:53 
GeneralRe: how to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 15:00
monica2k4-Sep-05 15:00 
GeneralRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 15:04
protectorChristian Graus4-Sep-05 15:04 
GeneralRe: how to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 15:18
monica2k4-Sep-05 15:18 
GeneralRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 15:33
protectorChristian Graus4-Sep-05 15:33 
In the control:

public delegate void ClickEvent();
public ClickEvent RefreshTree = null;

inside the click event handler for the button in the control:

if (RefreshTree != null) RefreshTree();


in the mainform:

void RefreshEvent()
{
theTree.Invalidate();
}

inside the create method, just after the call to initialisecomponents:

theControl.RefreshTree = new ControlType.ClickEvent(this.RefreshEvent);

There are a few things that need renaming, but that's basically it. The control defines the event and an instance of it. The main form defines the method and ties it to the event. The control calls the event if it's been set when the button is pressed. The method that is called refreshes the tree.

Christian Graus - Microsoft MVP - C++
GeneralRe: how to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 15:48
monica2k4-Sep-05 15:48 
GeneralRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 15:51
protectorChristian Graus4-Sep-05 15:51 
GeneralRe: how to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 16:54
monica2k4-Sep-05 16:54 
GeneralRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 16:56
protectorChristian Graus4-Sep-05 16:56 
GeneralRe: how to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 17:10
monica2k4-Sep-05 17:10 
GeneralRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 17:22
protectorChristian Graus4-Sep-05 17:22 
GeneralRe: how to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 17:31
monica2k4-Sep-05 17:31 
GeneralRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 17:33
protectorChristian Graus4-Sep-05 17:33 
GeneralRe: how to access main form controls from usercontrol on the form Pin
monica2k4-Sep-05 17:49
monica2k4-Sep-05 17:49 
GeneralRe: how to access main form controls from usercontrol on the form Pin
Christian Graus4-Sep-05 17:50
protectorChristian Graus4-Sep-05 17:50 
QuestionFinding variables of a special type Pin
User 66584-Sep-05 14:27
User 66584-Sep-05 14:27 
AnswerRe: Finding variables of a special type Pin
Christian Graus4-Sep-05 14:54
protectorChristian Graus4-Sep-05 14:54 
GeneralRe: Finding variables of a special type Pin
User 66584-Sep-05 15:01
User 66584-Sep-05 15:01 
Questionusing c# for console .exe Pin
Sasuko4-Sep-05 12:25
Sasuko4-Sep-05 12:25 
QuestionStarting Process "CMD.exe" Pin
sylvester20004-Sep-05 10:07
susssylvester20004-Sep-05 10:07 
AnswerRe: Starting Process "CMD.exe" Pin
Mohamad Al Husseiny4-Sep-05 15:01
Mohamad Al Husseiny4-Sep-05 15:01 
GeneralRe: Starting Process "CMD.exe" Pin
Bonsai20044-Sep-05 23:23
Bonsai20044-Sep-05 23:23 

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.