Click here to Skip to main content
15,904,935 members
Home / Discussions / C#
   

C#

 
QuestionHow to pass value to unspecified object using delegate C# Pin
rongvangso729-Jun-12 14:40
rongvangso729-Jun-12 14:40 
Hi guys, I have a FlowLayoutPanel containing unspecified number of Label ,when double click in one of them, a new Form containing a TextBox and a Button will appear, here is the code:

C#
...
     foreach (Label lb in FlowLayoutPanel1.Controls)
                            {
                                lb.MouseDoubleClick+=new MouseEventHandler(lb_MouseDoubleClick);
                            }
    ...
    private void lb_MouseDoubleClick(object sender, MouseEventArgs e)
            {
                NewForm form = new NewForm();
                form.ShowDialog();
                ((Label)sender).Text = ...;//I want get text from TextBox of the NewForm here
            }


I want get Text from TextBox of the NewForm and assign Text to the object that invoke the Form when user click the Button of the Form, I don't know how to use delegate to do this, please help! Thanks for reading this!
AnswerRe: How to pass value to unspecified object using delegate C# Pin
Richard Andrew x6429-Jun-12 16:08
professionalRichard Andrew x6429-Jun-12 16:08 
GeneralRe: How to pass value to unspecified object using delegate C# Pin
rongvangso729-Jun-12 20:12
rongvangso729-Jun-12 20:12 
GeneralRe: How to pass value to unspecified object using delegate C# Pin
OriginalGriff29-Jun-12 21:41
mveOriginalGriff29-Jun-12 21:41 
AnswerRe: How to pass value to unspecified object using delegate C# Pin
Richard Andrew x6430-Jun-12 5:42
professionalRichard Andrew x6430-Jun-12 5:42 
AnswerRe: How to pass value to unspecified object using delegate C# Pin
OriginalGriff29-Jun-12 21:35
mveOriginalGriff29-Jun-12 21:35 
GeneralRe: How to pass value to unspecified object using delegate C# Pin
rongvangso729-Jun-12 23:08
rongvangso729-Jun-12 23:08 
GeneralRe: How to pass value to unspecified object using delegate C# Pin
OriginalGriff29-Jun-12 23:44
mveOriginalGriff29-Jun-12 23:44 
AnswerRe: How to pass value to unspecified object using delegate C# Pin
Pete O'Hanlon30-Jun-12 7:47
mvePete O'Hanlon30-Jun-12 7:47 
GeneralRe: How to pass value to unspecified object using delegate C# Pin
rongvangso730-Jun-12 9:24
rongvangso730-Jun-12 9:24 
QuestionCombo Box Pin
DJCRIS1229-Jun-12 6:35
DJCRIS1229-Jun-12 6:35 
AnswerRe: Combo Box Pin
Kevin Marois29-Jun-12 6:59
professionalKevin Marois29-Jun-12 6:59 
GeneralRe: Combo Box Pin
DJCRIS1229-Jun-12 8:06
DJCRIS1229-Jun-12 8:06 
Questioninserting text into WebBrowser control Pin
Danzy8329-Jun-12 2:30
Danzy8329-Jun-12 2:30 
AnswerRe: inserting text into WebBrowser control Pin
Luc Pattyn29-Jun-12 2:43
sitebuilderLuc Pattyn29-Jun-12 2:43 
AnswerRe: inserting text into WebBrowser control Pin
Manfred Rudolf Bihy29-Jun-12 3:16
professionalManfred Rudolf Bihy29-Jun-12 3:16 
AnswerRe: inserting text into WebBrowser control Pin
Luc Pattyn29-Jun-12 3:26
sitebuilderLuc Pattyn29-Jun-12 3:26 
AnswerRe: inserting text into WebBrowser control Pin
Eddy Vluggen29-Jun-12 3:24
professionalEddy Vluggen29-Jun-12 3:24 
GeneralRe: inserting text into WebBrowser control Pin
Michael Potter29-Jun-12 3:39
Michael Potter29-Jun-12 3:39 
GeneralRe: inserting text into WebBrowser control Pin
Danzy8329-Jun-12 4:43
Danzy8329-Jun-12 4:43 
GeneralRe: inserting text into WebBrowser control Pin
Michael Potter29-Jun-12 5:01
Michael Potter29-Jun-12 5:01 
GeneralRe: inserting text into WebBrowser control Pin
Danzy8329-Jun-12 8:59
Danzy8329-Jun-12 8:59 
GeneralRe: inserting text into WebBrowser control Pin
Michael Potter29-Jun-12 9:27
Michael Potter29-Jun-12 9:27 
QuestionWhen register dll it generate tlb of DevExpress also Pin
MrKBA29-Jun-12 1:59
MrKBA29-Jun-12 1:59 
Questionare you missing a using directive or an assembly reference? Pin
1604198429-Jun-12 0:07
1604198429-Jun-12 0:07 

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.