|
-
Jun 17th, 2010, 05:15 PM
#1
Thread Starter
Fanatic Member
make background of textbox transparent? Is it possible?
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?
-
Jun 17th, 2010, 06:32 PM
#2
Re: make background of textbox transparent? Is it possible?
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.
-
Jun 17th, 2010, 06:35 PM
#3
Thread Starter
Fanatic Member
Re: make background of textbox transparent? Is it possible?
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?
Last edited by Gamemaster1494; Jun 17th, 2010 at 06:39 PM.
-
Jun 17th, 2010, 06:38 PM
#4
Re: make background of textbox transparent? Is it possible?
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?
-
Jun 17th, 2010, 06:42 PM
#5
Thread Starter
Fanatic Member
Re: make background of textbox transparent? Is it possible?
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.=)
-
Jun 17th, 2010, 07:37 PM
#6
Re: make background of textbox transparent? Is it possible?
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.
Last edited by FireXtol; Jun 17th, 2010 at 07:42 PM.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
Jun 17th, 2010, 07:54 PM
#7
Thread Starter
Fanatic Member
Re: make background of textbox transparent? Is it possible?
-
Jun 20th, 2010, 06:10 PM
#8
Member
Re: make background of textbox transparent? Is it possible?
.......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.
-
Jun 20th, 2010, 06:33 PM
#9
-
Jun 20th, 2010, 07:00 PM
#10
Member
Re: make background of textbox transparent? Is it possible?
How about making a transparent Textbox on a Form, "coloring the Form" with a full-sized Label with no Caption in it?
Oh my God Dilettante!!
This changes mi VB life!
So simple (=little code) and SO GREAT!!!
I'll thank you all my life for that
-
Jun 20th, 2010, 09:15 PM
#11
Thread Starter
Fanatic Member
Re: make background of textbox transparent? Is it possible?
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?
-
Jun 20th, 2010, 09:22 PM
#12
Re: make background of textbox transparent? Is it possible?
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|