Click here to Skip to main content
15,880,469 members
Home / Discussions / C#
   

C#

 
GeneralRe: Question regarding C# Pin
Abdulnazark18-Mar-15 3:25
Abdulnazark18-Mar-15 3:25 
GeneralRe: Question regarding C# Pin
Abdulnazark17-Mar-15 23:04
Abdulnazark17-Mar-15 23:04 
QuestionRLDC Report error : An error occurred during report processing. Pin
jasonalien17-Mar-15 0:13
jasonalien17-Mar-15 0:13 
QuestionC# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148716-Mar-15 23:04
Member 1153148716-Mar-15 23:04 
AnswerRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
OriginalGriff17-Mar-15 0:01
mveOriginalGriff17-Mar-15 0:01 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 0:24
Member 1153148717-Mar-15 0:24 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Freak3017-Mar-15 2:03
Freak3017-Mar-15 2:03 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
OriginalGriff17-Mar-15 2:36
mveOriginalGriff17-Mar-15 2:36 
Right...you need to think about this a bit...

You have FindForm_FindClicked set up as an event handler:
C#
private void Form1_Load(object sender, EventArgs e)
       {
           FindForm.FindClicked +=new frmFind.FindClickEventHandler(FindForm_FindClicked);
       }

But when you look at the definition of the method:
C#
void FindForm_FindClicked(string strToFind)
{
...
}
You haven't given it the right signature for an event handler - so it shouldn't compile, it should give a "No overload for ...." error.

Unless you have decided to pass the string directly from your event instead of the standard event signature, which is a poor idea - you really should pass the form instance, and event args (and use a custom event args if need really must pass more info at that time)

You would then use the form instance to access the search string:
C#
private void FindForm_FindClicked(object sender, EventArgs e)
       {
       frmFind finder = sender as frmFind;
       if (finder != null)
           {
           string strSearch = finder.SearchString;  
           ...
           }
       }
Where SearchString is a property of the frmFind form class that returns the user input.

Make sense?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

AnswerRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff17-Mar-15 4:56
professionalBillWoodruff17-Mar-15 4:56 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 5:24
Member 1153148717-Mar-15 5:24 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 5:38
Member 1153148717-Mar-15 5:38 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff17-Mar-15 7:46
professionalBillWoodruff17-Mar-15 7:46 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff17-Mar-15 22:11
professionalBillWoodruff17-Mar-15 22:11 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
Member 1153148717-Mar-15 23:49
Member 1153148717-Mar-15 23:49 
GeneralRe: C# Notepad Clone using a Textbox (not RichTextBox) Find / Find Next Function help? Pin
BillWoodruff18-Mar-15 17:01
professionalBillWoodruff18-Mar-15 17:01 
Questionhow to send any file from server to client in c# Pin
Member 1149066016-Mar-15 21:32
Member 1149066016-Mar-15 21:32 
AnswerRe: how to send any file from server to client in c# Pin
Eddy Vluggen16-Mar-15 23:27
professionalEddy Vluggen16-Mar-15 23:27 
AnswerRe: how to send any file from server to client in c# Pin
F-ES Sitecore16-Mar-15 23:40
professionalF-ES Sitecore16-Mar-15 23:40 
QuestionProblem parsing rss feed Pin
Member 1022623016-Mar-15 19:25
Member 1022623016-Mar-15 19:25 
AnswerRe: Problem parsing rss feed Pin
Pete O'Hanlon16-Mar-15 22:19
mvePete O'Hanlon16-Mar-15 22:19 
QuestionHow to call protected override void OnPaint(PaintEventArgs e) in another method in C# Pin
Member 1068390216-Mar-15 8:47
Member 1068390216-Mar-15 8:47 
AnswerRe: How to call protected override void OnPaint(PaintEventArgs e) in another method in C# Pin
Eddy Vluggen16-Mar-15 9:08
professionalEddy Vluggen16-Mar-15 9:08 
GeneralRe: How to call protected override void OnPaint(PaintEventArgs e) in another method in C# Pin
Member 1068390216-Mar-15 9:48
Member 1068390216-Mar-15 9:48 
Questionask about windorms and containers Pin
fsdsc216-Mar-15 4:56
fsdsc216-Mar-15 4:56 
AnswerRe: ask about windorms and containers Pin
OriginalGriff16-Mar-15 5:04
mveOriginalGriff16-Mar-15 5:04 

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.