By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,550 Members | 908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,550 IT Pros & Developers. It's quick & easy.

Pulsating BackColor of button?

P: n/a
I would like the background of a button so pulsate between to given colors
with the speed of a given timeinterval... I have two questions:

What can I use to control the interval thing with? I guess a Timer.. maybe?
is this fast enough to use as a mouseover effect on a Button?

How do I go from one color to another? Is there any built in functions for
these things or do I have to figure this out myself?

regards
/Try Guy


Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Create a custom control, drag a button onto the designer view and a timer,
use the timer to alter the BackColor.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
I would like the background of a button so pulsate between to given colors
with the speed of a given timeinterval... I have two questions:

What can I use to control the interval thing with? I guess a Timer.. maybe? is this fast enough to use as a mouseover effect on a Button?

How do I go from one color to another? Is there any built in functions for
these things or do I have to figure this out myself?

regards
/Try Guy


Nov 20 '05 #2

P: n/a
I have done it.. and it works fine.. until you want to use the XP look of
the buttons.. then my code is about useless it feels..

What do I need to do to make my Custom Button work with the XP style?

The only things I have really changed in my button is the backcolor of it,
in the MouseEnter and MouseLeave events..

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:O6**************@tk2msftngp13.phx.gbl...
Create a custom control, drag a button onto the designer view and a timer,
use the timer to alter the BackColor.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
I would like the background of a button so pulsate between to given colors with the speed of a given timeinterval... I have two questions:

What can I use to control the interval thing with? I guess a Timer..

maybe?
is this fast enough to use as a mouseover effect on a Button?

How do I go from one color to another? Is there any built in functions for these things or do I have to figure this out myself?

regards
/Try Guy



Nov 20 '05 #3

P: n/a

In the first lines of your Sub Main

Application.EnableVisualStyles()
Dim f as New Form1
f.ShowDialog()

Then ensure your button FlatStyle property is set to System

That should do it.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
I have done it.. and it works fine.. until you want to use the XP look of
the buttons.. then my code is about useless it feels..

What do I need to do to make my Custom Button work with the XP style?

The only things I have really changed in my button is the backcolor of it,
in the MouseEnter and MouseLeave events..

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:O6**************@tk2msftngp13.phx.gbl...
Create a custom control, drag a button onto the designer view and a timer,
use the timer to alter the BackColor.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
I would like the background of a button so pulsate between to given

colors with the speed of a given timeinterval... I have two questions:

What can I use to control the interval thing with? I guess a Timer..

maybe?
is this fast enough to use as a mouseover effect on a Button?

How do I go from one color to another? Is there any built in functions for these things or do I have to figure this out myself?

regards
/Try Guy




Nov 20 '05 #4

P: n/a
Hi,

http://www.thecodeproject.com/vb/net...on_control.asp

Ken
---------------------
"Try Guy" <no****@no.no> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
I have done it.. and it works fine.. until you want to use the XP look of
the buttons.. then my code is about useless it feels..

What do I need to do to make my Custom Button work with the XP style?

The only things I have really changed in my button is the backcolor of it,
in the MouseEnter and MouseLeave events..

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:O6**************@tk2msftngp13.phx.gbl...
Create a custom control, drag a button onto the designer view and a timer,
use the timer to alter the BackColor.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
I would like the background of a button so pulsate between to given colors with the speed of a given timeinterval... I have two questions:

What can I use to control the interval thing with? I guess a Timer..

maybe?
is this fast enough to use as a mouseover effect on a Button?

How do I go from one color to another? Is there any built in functions for these things or do I have to figure this out myself?

regards
/Try Guy




Nov 20 '05 #5

P: n/a
I don't have a Sub Main.. what's that and where should that be? I feel I'm
seriously not knowing something I should here...

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:%2******************@TK2MSFTNGP12.phx.gbl...

In the first lines of your Sub Main

Application.EnableVisualStyles()
Dim f as New Form1
f.ShowDialog()

Then ensure your button FlatStyle property is set to System

That should do it.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
I have done it.. and it works fine.. until you want to use the XP look of
the buttons.. then my code is about useless it feels..

What do I need to do to make my Custom Button work with the XP style?

The only things I have really changed in my button is the backcolor of it, in the MouseEnter and MouseLeave events..

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:O6**************@tk2msftngp13.phx.gbl...
Create a custom control, drag a button onto the designer view and a timer, use the timer to alter the BackColor.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
> I would like the background of a button so pulsate between to given

colors
> with the speed of a given timeinterval... I have two questions:
>
> What can I use to control the interval thing with? I guess a Timer..
maybe?
> is this fast enough to use as a mouseover effect on a Button?
>
> How do I go from one color to another? Is there any built in

functions for
> these things or do I have to figure this out myself?
>
> regards
> /Try Guy
>
>
>
>
>
>



Nov 20 '05 #6

P: n/a
I can get my button to look like an XP style button, not a problem.. (using
Manifest file) it's just that my Custumizing does'nt work then... the
fading backcolor of the button.

My costumizing of the button makes the button fade to another color when you
hover over it, and then goes back to backcolor when you leave it.. that only
works when I have a oldstyle look... it's like if my code doesn't work when
i use the XP style on the button..

/Try Guy


"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:%2******************@TK2MSFTNGP12.phx.gbl...

In the first lines of your Sub Main

Application.EnableVisualStyles()
Dim f as New Form1
f.ShowDialog()

Then ensure your button FlatStyle property is set to System

That should do it.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
I have done it.. and it works fine.. until you want to use the XP look of
the buttons.. then my code is about useless it feels..

What do I need to do to make my Custom Button work with the XP style?

The only things I have really changed in my button is the backcolor of it, in the MouseEnter and MouseLeave events..

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:O6**************@tk2msftngp13.phx.gbl...
Create a custom control, drag a button onto the designer view and a timer, use the timer to alter the BackColor.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:e$**************@TK2MSFTNGP12.phx.gbl...
> I would like the background of a button so pulsate between to given

colors
> with the speed of a given timeinterval... I have two questions:
>
> What can I use to control the interval thing with? I guess a Timer..
maybe?
> is this fast enough to use as a mouseover effect on a Button?
>
> How do I go from one color to another? Is there any built in

functions for
> these things or do I have to figure this out myself?
>
> regards
> /Try Guy
>
>
>
>
>
>



Nov 20 '05 #7

P: n/a
In your project properties, you can optionally set the project to run a Sub
Main, which you can put in a module file. This then executes instead of the
form being launched. In acual fact this is what happens anyway, when you
specify a Sub Main, you are simply creating your own home grown Sub Main.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:eQ**************@TK2MSFTNGP09.phx.gbl...
I don't have a Sub Main.. what's that and where should that be? I feel I'm
seriously not knowing something I should here...

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:%2******************@TK2MSFTNGP12.phx.gbl...

In the first lines of your Sub Main

Application.EnableVisualStyles()
Dim f as New Form1
f.ShowDialog()

Then ensure your button FlatStyle property is set to System

That should do it.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Try Guy" <no****@no.no> wrote in message
news:uB**************@tk2msftngp13.phx.gbl...
I have done it.. and it works fine.. until you want to use the XP look of the buttons.. then my code is about useless it feels..

What do I need to do to make my Custom Button work with the XP style?

The only things I have really changed in my button is the backcolor of it, in the MouseEnter and MouseLeave events..

/Try Guy
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> skrev i
meddelandet news:O6**************@tk2msftngp13.phx.gbl...
> Create a custom control, drag a button onto the designer view and a

timer,
> use the timer to alter the BackColor.
>
> HTH
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
> Time flies when you don't know what you're doing
>
> "Try Guy" <no****@no.no> wrote in message
> news:e$**************@TK2MSFTNGP12.phx.gbl...
> > I would like the background of a button so pulsate between to given colors
> > with the speed of a given timeinterval... I have two questions:
> >
> > What can I use to control the interval thing with? I guess a Timer.. > maybe?
> > is this fast enough to use as a mouseover effect on a Button?
> >
> > How do I go from one color to another? Is there any built in functions for
> > these things or do I have to figure this out myself?
> >
> > regards
> > /Try Guy
> >
> >
> >
> >
> >
> >
>
>



Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.