Don't draw text on button (and other controls)?

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
2 posts Page 1 of 1
Contributors
User avatar
Cheatmasterbw
Coding God
Coding God
Posts: 1506
Joined: Fri Jan 01, 2010 2:30 pm

Is there a way to make it so on a button's paint event (or any other controls paint event) to make the text not be drawn (without changing the text property)?

I want to manually redraw the text later on in a different location on the button.

Thanks :)
http://www.megaapps.tk/
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

Just make another property

Code: Select all
Public Class TextBoxMultiText
Inherits TextBox

_Private _MyText as string
Public Property MyText () As String
Get
Return _MyText 
End Get
Set(ByVal Value As Integer)
_MyText = value
End Set

End Class

End Property
This text will have two properties for text now, on 'Text' use "", and on your own _MyText use the text you want to store. It may not be the best way to do it, but it is easier for me :) Or just use controls Tag property. I do that all the time.
2 posts Page 1 of 1
Return to “Coding Help & Support”