Is it possible to get the White background of the textbox transparent? And, if so, the blinking line that appears there, how can i change the color of that?
Printable View
Is it possible to get the White background of the textbox transparent? And, if so, the blinking line that appears there, how can i change the color of that?
No you cannot make it transparent; however, you can fake transparency by copying what is behind the textbox inside the textbox. This can be very difficult to do especially if scrollbars are used. Here is a vbAccelerator project maybe you want to play with.
Another option could be... ??
1. Use a label and a textbox. The label has its backstyle set to transparent and is displayed.
2. When the user clicks on the label, you show the textbox and set focus to it, then hide the label if needed
3. When the user leaves the textbox, you update the label and hide the textbox
Note: labels cannot be tabbed to via the keyboard
Regarding the color of the caret, never tried it. But CreateCaret may be an API you want to use. Maybe creating a 1-2 pixel wide bitmap about the height of a single line of text and filling it with your color could do the trick. The CreateCaret API can take a bitmap handle for the caret.
Hmm..... Is there a way that someone using it would think that the label is being typed into(visible), and they are actually typing into the textbox(not visible)?
Or a way for the user to type into the label?
You could set your textbox, visible, off the form then set focus to it when the label is clicked. But how are you going to display a caret on a label?
Can i bitblt on the textbox them? no....... hmm....... okay. i dont want to get into anything complicated at the moment. Just was going to use it for a added effect. Thanks.=)
You could manually draw the 'textbox'.
The caret is basically a vbSrcInvert bitblt.
Or simply have a text box off screen, or whatever. Have a label that when clicked set's focus to the textbox, and have the textbox change event update the label, and have the textbox's getfocus/lostfocus control the rendering of a caret. You can use textwidth to get the approximate location of where to render it, which should be fairly straight-forward as long as it doesn't wrap.
Okay. thanks firextol!
.......Yes. However, I've been told that the old textboxes had the Transparent property, and they can be loaded from the "Microsoft Forms 2.0" component (FM20.dll). But they don't seem to work, at least in my PC.
You could try.
Or you could see why they don't work.
Well, good luck, and if you manage to do it, please tell us how it went.
How about making a transparent Textbox on a Form, "coloring the Form" with a full-sized Label with no Caption in it?
Here I have a transparent Label, a transparent Textbox, and a regular Textbox.
Oh my God Dilettante!!Quote:
How about making a transparent Textbox on a Form, "coloring the Form" with a full-sized Label with no Caption in it?
This changes mi VB life!
So simple (=little code) and SO GREAT!!!
I'll thank you all my life for that
Nah. that is what i was trying not to use was another form. That is a REALLY cool example. can u explain some of the code to me more please?
Well, there isn't much code to explain. LaVolpe is probably laughing, I'm not much for graphics manipulation.
All it really does is set the Form to transparent using a ColorKey color. The extra Label isn't colored with the "make it transparent" color so that it covers up the transparent Form.