creating class to control TextBox
Page 1 of 19 Replies - 711 Views - Last Post: 13 October 2012 - 03:30 AM
#1
creating class to control TextBox
Posted 11 October 2012 - 01:42 AM
I am new C# programmer and I have problem to create a class .
Here I have problem to create class to control TextBoxex.
for example to control the number or letter , date or ... . which , I can use in all my projects.
Unfortunetly I have problem to write its method .
I would be very happy if you can help me to write this class.
Voice of Silence
Replies To: creating class to control TextBox
#2
Re: creating class to control TextBox
Posted 11 October 2012 - 01:48 AM
#3
Re: creating class to control TextBox
Posted 11 October 2012 - 03:16 AM
#4
Re: creating class to control TextBox
Posted 11 October 2012 - 03:36 AM
Also don't forget to review Methods
This post has been edited by Michael26: 11 October 2012 - 03:38 AM
#5
Re: creating class to control TextBox
Posted 11 October 2012 - 03:49 AM
Michael26, on 11 October 2012 - 03:36 AM, said:
Also don't forget to review Methods
Yes, I am agree with you that I have to review.
I can work with events when I write an event for a user control but my main problem is that I can not use them in a class.
#6
Re: creating class to control TextBox
Posted 11 October 2012 - 06:53 AM
#7
Re: creating class to control TextBox
Posted 11 October 2012 - 07:09 AM
voice.of.silence, on 11 October 2012 - 03:49 AM, said:
I can work with events when I write an event for a user control but my main problem is that I can not use them in a class.
Can you explain why you cannot use an event in a class? Is there some kind of design constraint that you are working with?
#8
Re: creating class to control TextBox
Posted 11 October 2012 - 08:12 AM
#9
Re: creating class to control TextBox
Posted 11 October 2012 - 01:32 PM
Quote
I think what you are really talking about is inheritance.
If you want to make a textbox that can only have 12 characters entered, or a textbox that can only have numbers entered... Is that the kind of 'control' you're talking about?
What you do is make a new class that has inherited from TextBox then add code to give it the behavior you want. Do a google for "MSDN numeric textbox" and that will give you a link to a tutorial for building an inherited textbox with custom behavior
#10
Re: creating class to control TextBox
Posted 13 October 2012 - 03:30 AM
|
|

New Topic/Question
Reply



MultiQuote





|