 |
|
 |
I found this control really wonderful. Thanks for that. I wanted to ask if there is a way to Fade in and out Images on roll over and away events.
Lets say if I want the image in the 'BackgroundImage' property to be faded into 'Image' property when the mouse enters (animation starts) and revert back to the background image when the mouse leaves.
May be this may cause the control to be a bit slow, but this is an effect I have been looking for quite a time.
If you can help in this regard, I will be very grateful.
thank you.
|
|
|
|
 |
|
 |
Unfortunately it's not that easy. My code draws only animated background. Foreground (text and image) is not drawn directly by my code. I have private Button _imageButton field, and invoke its paint method (but not directly) to draw specified foreground. Implementing animated foreground would require to make serious changes to the code, which wouldn't be easy.
Regards,
Łukasz
|
|
|
|
 |
|
|
 |
|
 |
Thanks for being kind of enough to provide this excellent tool to the community!
|
|
|
|
 |
|
 |
You're welcome.
|
|
|
|
 |
|
 |
will you be releasing a VB .NET version of this control?
R. Ainger
|
|
|
|
 |
|
 |
I'm not sure, but probably I will.
Lukasz
|
|
|
|
 |
|
 |
Looks really sharp! Thanks!
|
|
|
|
 |
|
|
 |
|
 |
Hello,
can I use your control in a freeware library?
The library contains controls who makes a vista style.
My Site: julian-w.de
(Sorry for my bad English, I'm from Germany)
|
|
|
|
 |
|
 |
Hello,
I repeat a post which is somewhere below:
"Basically, anyone can use my dll file or the source code. I forbid only including it in some controls/components packs and similar libraries."
So, you can if it will be only for your applications. But you cannot if you are planning to release it for everyone, sorry.
Lukasz
|
|
|
|
 |
|
 |
OK, then I only link to this page and include the code directly in my program
My Site: julian-w.de
(Sorry for my bad English, I'm from Germany)
|
|
|
|
 |
|
 |
I have a question.
I develop a library for time to play media files(images, music and videos).
There is a graphiches interface, for which I also took advantage of your library.
In this library are still other controls included (Vista List View, TreeView, Status List, etc.), but the acces is only "internal class".
At the end there will be a DLL file.
Is that okay?
(I hope you understand me)
My Site: julian-w.de
(Sorry for my bad English, I'm from Germany)
|
|
|
|
 |
|
 |
Yes, it's OK. You can use glass button in that way.
Regards,
Lukasz
|
|
|
|
 |
|
 |
This is a great control! You suggested in a previous thread to use the button's DrawToBitmap method to save the button as an image. Do you know how to keep a transparent background when doing the save? I'd like to end up with a semi-transparent png of the entire button, without the background. Using your CreateBackgroundFrame method gets me close, but doesn't include the foreground (text, image, etc).
I have tried overriding the OnPaintBackground, but it didn't seem to do the trick.
protected override void OnPaintBackground(PaintEventArgs e)
{
e.Graphics.FillRectangle(Brushes.Transparent, this.Bounds);
}
Any suggestions?
Thanks!
|
|
|
|
 |
|
 |
I use this code and it works:GlassButton gb = new GlassButton();
gb.Size = new Size(75, 23);
gb.Text = "Text";
Image img = new Bitmap(bg.Width, bg.Height);
using (Graphics g = Graphics.FromImage(img))
{
g.Clear(Color.Transparent);
gb.DrawButtonBackgroundFromBuffer(g);
gb.DrawForegroundFromButton(new PaintEventArgs(g, gb.ClienrRectangle));
}
img.Save("file.png");
Lukasz
|
|
|
|
 |
|
 |
Thanks for your help! Now I have a version of this that works for the web!
|
|
|
|
 |
|
 |
You're welcome
|
|
|
|
 |
|
 |
Hello, great work! But only thing: I'll want to use this great buttons in an unmanaged MFC-Application. Is it possible to rewrite your Code in C++ or to make an ActiveX-Control from that? Or did you have eventually this as an AvtiveX-Ctrl?
Greetings Oliver
|
|
|
|
 |
|
 |
Hello,
If an MFC application uses the glass button, it has to be a managed application.
The button could be also wrapped in an MFC class, but it would still require the .NET Framework and would have to be compiled as a managed dll.
I do not have it as an ActiveX control.
Regards,
Lukasz
|
|
|
|
 |
|
 |
Is there a way to use this on a web page?
|
|
|
|
 |
|
 |
No. WindowsForms controls cannot be used on a web page.
Lukasz
|
|
|
|
 |
|
 |
Hi,
great thing, this little project.
but what happens if i clicked the button is:
if i leave the button his color becomes black (like backcolor).
i think the button should look normal as before.
is there a workaround to give the button such a functionality ?
Stulle
|
|
|
|
 |
|
 |
Hi,
Sorry, but I couldn't reproduce this behavior. Can you be more specific?
Lukasz
|
|
|
|
 |
|
 |
Hi,
ok, in the procedure ongotfocus of the button i've set a new backcolor, but saving the old value.
in the procedure onlostfocus i've set the backcolor back to it's old value.
if i now lose the focus for this button, it's backcolor will always become black.
I hope this describes the problem in a easily comprehensible way.
Stulle
|
|
|
|
 |