Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling button click method from another control
Message
From
30/06/2008 12:25:34
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01327390
Message ID:
01327667
Views:
11
>Tim,
>
>That's a good idea. In fact, it's what I do in FoxPro most of the time with buttons. I get so focused on the things that are different in .NET I sometimes forget the things that should be the same.
>

I sure know what you mean. I did that very thing myself just a few days ago.
Tim

>
>>Hi Linda,
>>
>>>I have a form which has a variety of criteria a user can enter for locating a particular record. If they enter a specific id, I would like to go ahead and fire the click method of the button to locate a record. It seems like it should be obvious to me but I can't figure out what parameters to pass to the click method. I tried passing the arguments that were passed to the Leave method of the text box but that did not work. Can anyone help with this? Thanks.
>>
>>It would be better to factor the code in the button click out so you can call it from other places.
>>
>>
>>
>>private void btnGetRecords_Click(sender object, EventArgs e)
>>{
>>     // Move all your code here to the GetRecords method
>>     this.GetRecords()
>>}
>>
>>private void GetRecords()
>>{
>>     // Put all your code that was in the click event here so you can call it from multiple places
>>}
>>
>>
>>
>>Hope that helps and answers your question
>>Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform