473,385 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Pulsating BackColor of button?

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
7 1947
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
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

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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: MLM450 | last post by:
I am trying to create a button on a toolstrip that is used to select a color. After the user selects their color, a portion of the button's image is changed to that color (similar to the...
6
by: LU | last post by:
A)I build a datagrid based on a calendar date selection. B)When user clicks a button column on the datagrid I want to highlight this row. I use the code below to highlight the row. ***** CODE...
1
by: Firewalker | last post by:
I am attempting to change the backColor property on the previously instantiated buttons FROM a listbox_doubleClick event. I thought it would be something like this: If...
5
by: Zytan | last post by:
In the IDE, I changed the BackColor of a button. Then, I changed it back to what I thought was the default, 'Control'. But, the bolded text didn't disappear (I think bold means the setting is not...
4
by: Rob | last post by:
This should be simple..... The default BackColor of a button (if you look at its property) is "Control" its a gray color, but apparently not a color. During a process I set the BackColor of a...
5
by: DonnaDarko | last post by:
I need help again if possible! I want to offer two options for a future user of my program. In Option1(0), the variable resSat must be known and is then used to calculate the variable Mass_BLOB....
0
by: sweatha | last post by:
Hello Friends I have created the project with 2 forms. In the first form, I have 2 buttons. The first button has the backcolor as "fusia" by default. If I click the button means then backcolor of...
2
by: Danielle | last post by:
All - Thanks in advance for any help you can provide. I've been working with a GridView in Visual Basic for a long time trying to get a list of contacts and to be able to edit and delete the...
1
by: Alkdarf | last post by:
I monitor door cameras with a third party application that gives me multiple video windows for the various video inputs in the card. I want to create an application that will overlay the video...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.