Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Texbox Custom Control

Status
Not open for further replies.

jpaulino

Programmer
May 28, 2002
26
0
0
DE
Hi all,

I'm making a custom textbox control and I did it. The problem is that to set two new features I lost the other ones.

I'm making gotfocus and lostfocus effect but I lost most of them like passwordchar, multiline, textaligment, etc.

Any ideas ???

Tanks
Jorge
 
GotFucus and LostFocus are events (handlers). The others that you mentioned are simple methods.

The only thing i can imagine you are doing is that you propably created a new control and draged a textbox to it. I am quite sure that that's your mistake. If you are extending a control (only one) e.g. textbox, create a new class library (name it: myCustomTextbox) and do like:

Public Class myCustomTextbox
Inherits System.windows.forms.textbox

' your code here
' ...

End Class

By that bold, you got everything from a textbox, plus thing you add by code.
** Note that by using the keyword "Me", you are 'speaking' to the textbox. So: Me.Multiline=True is valid, whereas in a windows form is not.


Hope these help
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top