I just havent used vb in a while, so its not me thats a n00b, just me question
Now that that is clarified, I want to make a textbox act like a label (so you cant have a caret or select stuff).
How do I do that simple thing?
:)
Printable View
I just havent used vb in a while, so its not me thats a n00b, just me question
Now that that is clarified, I want to make a textbox act like a label (so you cant have a caret or select stuff).
How do I do that simple thing?
:)
text1.enabled=false
doesnt that make it gray?
how do I keep it black?
I also need to make this respond to click events
:)
usually newbie questions are answered quickly
or is this too tough for you????
MWAHAHAHAHAHA
Then skip the .enabled idea....
and set the .Locked = true
nevermind that doesn't work...
Ah for pete's sake, just use a label.....
Try thisVB Code:
Private Declare Function HideCaret Lib "user32" ( ByVal hwnd As Long) As Long Private Sub Text1_GotFocus() HideCaret Me.hwnd End Sub
That code looked golden Hack, thought to myself, wow, look at that elegance....
doesn't work though... at least on XP ...
Ah, but it does work....
Me.Hwnd
Needs to be Text1.Hwnd
Forgive me master....:eek:
Another alternative (can never have too many)...
Put the textbox in a frame, and disable the frame.
:)
Quote:
Originally posted by crptcblade
Another alternative (can never have too many)...
Put the textbox in a frame, and disable the frame.
:)
VB Code:
vbQuote = """ MyText = "Hello My Name Is " & vbQuote & "Ryan" & vbQuote
Ooops... wrong question... :p
come on guys....what the big deal in this...
textbox.enabled=false
textbox.backcolor=vbgray
Quote:
Originally posted by faisalkm
come on guys....what the big deal in this...
textbox.enabled=false
textbox.backcolor=vbgray
He doesn't want it grey, I'm guessing...
Wouldn't this work?
Text1.locked = True
I could be wrong :)
OOPS.. never mind. He said so you cant select stuff :)
perhaps something like:
VB Code:
Private Sub txtBox_GotFocus() SomeOtherControl.SetFocus End Sub
That's what I usually do.Quote:
Originally posted by Slaine
perhaps something like:
VB Code:
Private Sub txtBox_GotFocus() SomeOtherControl.SetFocus End Sub
Label still the best way to go..... :)
Why are you people still answering if it was already answered?:confused: :eek:
Overkill. It's called overkill.Quote:
Originally posted by numtel
Why are you people still answering if it was already answered?:confused: :eek:
:)
and you like this?:pQuote:
Originally posted by rjlohan
Overkill. It's called overkill.
:)
I'm still curious as to why a label can't be used?
....
yah a label saves memory too.
make the borderstyle to 3d and the backcolor to white