Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to compare password from notepad with in the textbox Pin
krajah1027-Mar-07 6:03
krajah1027-Mar-07 6:03 
GeneralRe: How to compare password from notepad with in the textbox Pin
Khoramdin27-Mar-07 6:28
Khoramdin27-Mar-07 6:28 
QuestionNew workspace window Pin
sinosoidal27-Mar-07 4:15
sinosoidal27-Mar-07 4:15 
AnswerRe: New workspace window Pin
Christian Graus27-Mar-07 4:22
protectorChristian Graus27-Mar-07 4:22 
Questionconnect Dataset with reportviewer Pin
FrankBoonen27-Mar-07 4:10
FrankBoonen27-Mar-07 4:10 
QuestionHow can i rename a file?? Pin
Test27030727-Mar-07 4:10
Test27030727-Mar-07 4:10 
AnswerRe: How can i rename a file?? Pin
Martin#27-Mar-07 4:19
Martin#27-Mar-07 4:19 
QuestionEvent and EventHandler for communication required Pin
Starzfighter27-Mar-07 3:56
Starzfighter27-Mar-07 3:56 
Short explanation of the situation:
In my Form (main) i have embbeded a datagrid and a usercontrol with a panel inside on which i paint the names (nodes) of the datagrid.
for example in a treeview it would look like this:
food
+-meat
+-bread
###+-corn
###+-wheat
food can be bread or meat. On the panel of the usercontrol i draw then the food, the meat and the bread. Then i draw two lines to connect the food with the meat and the bread. Now i want to click on the bread and a contextMenu shouldappear with Next. When i click next it should repaint the panel with
bread
+-corn
+-wheat
To do so i need to go back to the datagrid and select the bread there. I have allready a method which selects me the right cell when i give it the text which item should be selected (here the string: bread). But here is my problem.
How do i send a message form the usercontrol to the form.
I was thinking it should work somehow with an event.
But i don't know exactly how to do it or where to start.
(Something like observer pattern)

I make an event in the usercontrol.
And the Form should notice it when the event is executed.
i thought on something like this:
in usercontrol:
public event EventHandler next = null;

and in the form:
usercontrol.next +=new EventHandler(usercontrol_back)

and then the handler for it.

private void usercontrol_next(object sender, EventArgs e)
{
//the method i need to call
}


but how do I say in my usercontrol that the event should be fired or started?
How does my form notice that the event is fired in my usercontrol?
And how do i get the string from the usercontrol to my datagrid (in the form)?

AnswerRe: Event and EventHandler for communication required Pin
Not Active27-Mar-07 5:21
mentorNot Active27-Mar-07 5:21 
QuestionPassing Recordset from C# COM to VBScript Pin
rahvyn627-Mar-07 3:49
rahvyn627-Mar-07 3:49 
Questionend (break) Pin
SVb.net27-Mar-07 3:46
SVb.net27-Mar-07 3:46 
AnswerRe: end (break) Pin
Christian Graus27-Mar-07 3:48
protectorChristian Graus27-Mar-07 3:48 
GeneralI rarely say this Pin
Ennis Ray Lynch, Jr.27-Mar-07 5:13
Ennis Ray Lynch, Jr.27-Mar-07 5:13 
GeneralRe: end (break) Pin
SVb.net28-Mar-07 6:38
SVb.net28-Mar-07 6:38 
QuestionHow could i dispose a windows form. Pin
Test27030727-Mar-07 3:40
Test27030727-Mar-07 3:40 
AnswerRe: How could i dispose a windows form. Pin
Martin#27-Mar-07 3:44
Martin#27-Mar-07 3:44 
GeneralRe: How could i dispose a windows form. Pin
Test27030727-Mar-07 3:53
Test27030727-Mar-07 3:53 
AnswerRe: How could i dispose a windows form. Pin
Christian Graus27-Mar-07 3:48
protectorChristian Graus27-Mar-07 3:48 
GeneralRe: How could i dispose a windows form. Pin
Test27030727-Mar-07 4:06
Test27030727-Mar-07 4:06 
GeneralRe: How could i dispose a windows form. Pin
Christian Graus27-Mar-07 4:23
protectorChristian Graus27-Mar-07 4:23 
GeneralSending UDP packets Pin
V.27-Mar-07 3:40
professionalV.27-Mar-07 3:40 
QuestionWindows Forms Pin
7127-Mar-07 3:22
7127-Mar-07 3:22 
AnswerRe: Windows Forms Pin
Christian Graus27-Mar-07 3:35
protectorChristian Graus27-Mar-07 3:35 
GeneralRe: Windows Forms Pin
Martin#27-Mar-07 3:40
Martin#27-Mar-07 3:40 
AnswerRe: Windows Forms Pin
Martin#27-Mar-07 3:36
Martin#27-Mar-07 3:36 

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.