-
1 Attachment(s)
Dealing With .NET Transparency Ctrls
I like to graphically design some of my apps.
But using .NET controls (picbox, label) is not to my liking.
In VB6 I could put a label over any picture (on form or picturebx) and EVERYTHING under it would show.
In .NET I have not found a way to do this.
I've tried every transparency setting there is for label and picturebox, but still can not just do a simple task that was so easy in VB6.
SEE ATTACHED PICTURE (below)
It works fine if you just put it on a form... and thats it!
It will work if you put a picture in the form. But the picture is tiled... so what about resizable forms where you only want the one instance of the picture to show... plus if you have a toolbar.... to bad...
the top of the picture disappears under the toolbar!!
What was MS thinking??
How do they expect people to use these "transparency" on controls. The form color is really the transparent color!! duh :rolleyes:
THAT IS NOT TRANSPARENT!!
I REPEAT...
THAT IS NOT TRANSPARENT!!
So, far I have liked .NET up to this point, but unless I can find some easily implementable methods to make ONE stupid label control "transparent" so that everything under it is VISIBLE....
Then what is the point... Graphical interfaces are only do able if you create a graphic that shows it all.
How will people make wizards that have labels of text over pictures that change frequently.
COME ON MS.... WHAT ARE YOU THINKING!
there, I am done ranting.
:mad:
-
Re: Disappointed With .NET Graphics
if you want the label below other controls, make it first.
might be a fix for the case after you've made all the controls and don't want to start over, but that's what i do.
-
Re: Disappointed With .NET Graphics
Instead of a label control you could just use the graphics to draw the text on.
-
Re: Disappointed With .NET Graphics
Choey,
Ahh... great if I want to set the zorder.
If you put the label behind the blue box... you won't see the label.
I am talking about transparency.
The label and picbox (dove) 's backcolor is set to Transparency.
Do they look transparent to you?
RobDog...
I've tried that... but how do you put a whole paragraph from a textbox over a picture without sending each line one by one? Not to mention the re-painting of the text if another form goes over it.
And how would you draw a transparent gif over the blue box?
Thanks....
But :cry:
-
Re: Disappointed With .NET Graphics
There was a demo that would be perfect for you. I think it was be Wokawidget here in vb.net forum.
I will look for it. Be back in a couple of hrs. Time to go home. :thumb:
Ewe, 9666 posts.
-
Re: Disappointed With .NET Transparency Ctrls
-
1 Attachment(s)
Re: Disappointed With .NET Transparency Ctrls
well.... that's nice.
But, doesn't help a bit.
How do I put a transparent gif on top of a picture box??
How do I put a transparent paragraph of text on top of a picturebox??
Is this to hard of a question?
You can put these 2 controls on top of a form with a background picture and it will work. But you can't put them on top of a picture box or panel. (see below)
As you can see with the 2nd pic... the transparency does not show the brick background of the picbox... but the form background.
That is no TRUE transparency!!
.
-
Re: Disappointed With .NET Transparency Ctrls
If I could use just the form, that would be great.
But you have no control over the background picture because...
1) It only tiles the pictures. So if I needed to display just one picture (not tiled) then I would have to size the form to the size of the picture. Leaving me no choice but to use Single Fixed for borderstyle. So if the pic changes the border would have to change to.
2) You can put a toolbar (or any other controls) on the form. But any picture you put in the background will be covered up by the other controls.
How is anyone suppose to make a graphical application if they can't even use transparent controls that can be moved around.
Very disappointed...
:cry: :mad: :rolleyes:
-
Re: Disappointed With .NET Transparency Ctrls
I only see one way to get around the transparent label...
and that is find a standlone OCX label that supports "TRUE" transparency that I can convert with a wrapper DLL to use in .NET
Anyone know of an OCX label just like the one on the standard toolbox of VB6???
I would really appreciate it.
FYI... I did find a .NET label control off of PSC that someone tried to make. And it does work for one line only... it's buggy though. Doesn't wrap the text like a regular label control is suppose to. So I can't use it.
I'd make one myself, but haven't got a clue how to.
Thanks
-
Re: Disappointed With .NET Transparency Ctrls
Have you tried making your own standalone OCX, with but a simple label on it? It is pretty easy, and you can do the resizing stuff in a few lines of code. "Inheriting" Properties from the OCX to the Label might be a trick...
-
Re: Disappointed With .NET Transparency Ctrls
OK, as the resident graphics boffin :D...
1. Its dead easy to draw a paragraph of text onto a picturebox (assuming it doesn't spill over onto another control. Just take a look at the Graphics.DrawString(...) overrides and you will find one that lets you specify a rectangle to draw the text inside. You can work out the rest.
2. Transparency of controls can be accomplished but it is pretty low level. You may have to resort to blitting from a graphics object. I hate using bitblt because it is not framework.
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by Dave Sell
Have you tried making your own standalone OCX, with but a simple label on it? It is pretty easy, and you can do the resizing stuff in a few lines of code. "Inheriting" Properties from the OCX to the Label might be a trick...
I've never made a control in VB6 or .NET
I could try in VB6... because the label is already made. I would just have to figure out how to add all those properties.
Can you help me and get me started?
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by wossname
OK, as the resident graphics boffin :D...
1. Its dead easy to draw a paragraph of text onto a picturebox (assuming it doesn't spill over onto another control. Just take a look at the Graphics.DrawString(...) overrides and you will find one that lets you specify a rectangle to draw the text inside. You can work out the rest.
2. Transparency of controls can be accomplished but it is pretty low level. You may have to resort to blitting from a graphics object. I hate using bitblt because it is not framework.
The paragraph text would always change and I would never know how long it would be. I have to contain the text in a given area that depends on the size of the area because the form is resized.
I want to stay with true framework... no VB6 code.
-
Re: Disappointed With .NET Transparency Ctrls
If I did create my own OCX in VB6...
The only properties I need to talk to would be...
label1.backstyle
label1.backcolor
label1.forecolor
label1.caption
label1.alignment
label1.Font
label1.height
label1.width
label1.left
label1..top
label1.index
label1.tag
label1.visble
label1.tooltip
label1.wordwrap
That's about it
-
Re: Disappointed With .NET Transparency Ctrls
A bitblt demo in .net. Create a form and add a button to the bottom right corner. then add this code to the button's click event.
With some tinkering, this could be used to simulate transparency.
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dest As Graphics = Me.CreateGraphics
Dim src As Graphics = Button1.CreateGraphics
Dim destH As IntPtr = dest.GetHdc()
Dim srcH As IntPtr = src.GetHdc()
BitBlt(destH.ToInt32, 10, 10, Button1.Width, Button1.Height, srcH.ToInt32, 0, 0, 13369376)
dest.ReleaseHdc(destH)
src.ReleaseHdc(srcH)
End Sub
Anyway I'm busy now so this is the last i shall say on the subject for a while anyway. :)
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by epixelman
I would never know how long it would be.
:rolleyes:
Graphics.MeasureString(...)
-
Re: Disappointed With .NET Transparency Ctrls
I don't know when I'll have the time to mess around with this, but here are some useful links:
http://blogs.msdn.com/ajma/articles/213868.aspx
http://www.freevbcode.com/ShowCode.Asp?ID=1695
It really should be pretty straigtforward if you use the "ActiveX Control Interface Wizard".
Make a new ActiveX Control project, drop a Label on it, and run the wizard!
I dunno if it includes this, but I like to use this too, if I'm just extending a single Control like you will be:
VB Code:
Private Sub UserControl_Resize()
Height = LabelControl.Height
Width = LabelControl.Width
LabelControl.Top = 0
LabelControl.Left = 0
End Sub
-
Re: Disappointed With .NET Transparency Ctrls
Thanks,
I'll give it a try
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by epixelman
Thanks,
I'll give it a try
Cool, good luck! Also make sure to use Binary Compatibility:
http://www.vbforums.com/showthread.p...=10+easy+steps
If you get stuck, just ask! Might be better to pose new questions in the COM & ActiveX Forum.
-
Re: Disappointed With .NET Transparency Ctrls
-
1 Attachment(s)
Re: Disappointed With .NET Transparency Ctrls
-
Re: Disappointed With .NET Transparency Ctrls
Okay... got it.
I play with this for awhile
Do you know how I can make the UserControl transparent that will work on Win9x? I know it will work on XP
Thanks
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by epixelman
Okay... got it.
I play with this for awhile
Do you know how I can make the UserControl transparent that will work on Win9x? I know it will work on XP
Thanks
i dont think transparency is supported at all in the 9x systems... i believe the first OS to include that in the API is 2000
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by kleinma
i dont think transparency is supported at all in the 9x systems... i believe the first OS to include that in the API is 2000
I would think that any OS that can run the framework will be fine for transparencies as done in .net code.
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by wossname
I would think that any OS that can run the framework will be fine for transparencies as done in .net code.
The documentation states that it only works on platforms that support layered windows, ie 2k, XP, and 2k3.
-
Re: Disappointed With .NET Transparency Ctrls
I have started a thread in the ActiveX - COM forum.
I am developing a label control (VB6) that I will beable to use in .NET
Go there to view more...
http://www.vbforums.com/showthread.p...=1#post1953633
-
Re: Disappointed With .NET Transparency Ctrls
Part of the solution to this thread is the creation of an OCX file that will work in .NET
At this time, I have it working but I have one problem I can't figure out.
Please go to this thread (Com and ActiveX) to help fix my problem...
http://www.vbforums.com/showthread.p...=1#post1953633
P.S. I don't like posting in the "Com And ActiveX" forum (even though I have to) because people don't visit enough.... So I will post here concerning updates until this thread is solved.
Thanks
.
-
Re: Disappointed With .NET Transparency Ctrls
Okay... I am just a few feet to finding a solution for the .NET label transparency.
I have one problem with the control I am making...
See thread...
http://www.vbforums.com/showthread.p...=1#post1953633
.
-
Re: Dealing With .NET Transparency Ctrls
Okay... I got the control to work, but now I have a graphic look problem...
JAGGIES
Please see more at...
http://www.vbforums.com/showthread.p...=1#post1953633
.
-
Re: Disappointed With .NET Transparency Ctrls
Quote:
Originally Posted by epixelman
I am developing a label control (VB6) that I will beable to use in .NET
That really isn't necessary...
http://www.vbforums.com/showpost.php...1&postcount=12
:smug:
-
Re: Dealing With .NET Transparency Ctrls
Hey Wossname
How is that transparent label going?
Thanks
Frank
-
Re: Dealing With .NET Transparency Ctrls
Start a project
Put two picturebox's on the form
Set the background picture of one form to whatever you like.
Set the image property of the other picturebox to contain a transparent gif and set the backcolor to transparent.
Now you want the transparent gif to show the background of the first picturebox and NOT the background of the form.
Here it is.....one friggin line....
PictureBox2.Controls.Add(PictureBox1)