Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends

i want to create class file which extends the Textbox.
and also want to handle the mouse click event on textbox
so how to do it??

thanks in advance
Posted
Comments
Arav Pradeep Gupta 24-Apr-12 2:29am    
What about "extends the Textbox.".

make clear your requirement so we can provide you solution.
Sumit Memane 24-Apr-12 2:32am    
i am creating a single class file which is going to extend the TextBox class.

now i want to handle the event on that textbox..


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TextBox_Test
{
public class Class1 : TextBox
{
int var1;
int var2;
int var3;
int var4;

/*** here i want to add event handler which handles the mouseclick event ****/
}
}

1) Bring up your class in the designer, in Design View
2) In the Properties pane, press the Events button (it looks like a lightening bolt)
3) Double click the Click event.

That will create a handler, hook it all up, and take you to the code for the event handler method.
 
Share this answer
 
Comments
VJ Reddy 24-Apr-12 3:43am    
+5
You have to add a custom event to extended textbox class..

Go through below mentioned link ..

http://stackoverflow.com/questions/1768633/how-can-i-add-mouse-click-event-to-web-textbox-in-c-sharp[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900