Click here to Skip to main content
15,918,050 members
Home / Discussions / C#
   

C#

 
QuestionHook the tab key on Window Form Pin
Duong Tien Nam4-Sep-05 17:32
Duong Tien Nam4-Sep-05 17:32 
AnswerRe: Hook the tab key on Window Form Pin
Luis Alonso Ramos4-Sep-05 20:04
Luis Alonso Ramos4-Sep-05 20:04 
AnswerRe: Hook the tab key on Window Form Pin
Sheel Gohe4-Sep-05 20:08
Sheel Gohe4-Sep-05 20:08 
GeneralRe: Hook the tab key on Window Form Pin
Duong Tien Nam4-Sep-05 20:11
Duong Tien Nam4-Sep-05 20:11 
GeneralRe: Hook the tab key on Window Form Pin
Duong Tien Nam4-Sep-05 21:04
Duong Tien Nam4-Sep-05 21:04 
QuestionAcceptButton for a UserControl? Pin
WetRivrRat4-Sep-05 16:33
WetRivrRat4-Sep-05 16:33 
AnswerRe: AcceptButton for a UserControl? Pin
Luis Alonso Ramos4-Sep-05 16:59
Luis Alonso Ramos4-Sep-05 16:59 
Questionruler control Pin
azusakt4-Sep-05 16:32
azusakt4-Sep-05 16:32 
AnswerRe: ruler control Pin
Christian Graus4-Sep-05 16:35
protectorChristian Graus4-Sep-05 16:35 
AnswerRe: ruler control Pin
Mohamad Al Husseiny4-Sep-05 16:36
Mohamad Al Husseiny4-Sep-05 16:36 
GeneralRe: ruler control Pin
azusakt4-Sep-05 16:42
azusakt4-Sep-05 16:42 
QuestionI darg-drop item to a WebBrowser control Pin
Member 19785854-Sep-05 15:31
Member 19785854-Sep-05 15:31 
AnswerRe: I darg-drop item to a WebBrowser control Pin
Christian Graus4-Sep-05 15:34
protectorChristian Graus4-Sep-05 15:34 
GeneralRe: I darg-drop item to a WebBrowser control Pin
Member 19785854-Sep-05 16:55
Member 19785854-Sep-05 16:55 
GeneralRe: I darg-drop item to a WebBrowser control Pin
Christian Graus4-Sep-05 16:58
protectorChristian Graus4-Sep-05 16:58 
GeneralRe: I darg-drop item to a WebBrowser control Pin
Member 19785854-Sep-05 20:31
Member 19785854-Sep-05 20:31 
GeneralRe: I darg-drop item to a WebBrowser control Pin
Christian Graus5-Sep-05 10:52
protectorChristian Graus5-Sep-05 10:52 
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++

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.