First off, you can make the code smaller by using the Mod statement,
Secondly, don't use loops for pauses (what if someone has a 186? or a
1millionzillion86?)
> Private Sub rbASME1_CheckedChanged(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles rbASME1.CheckedChanged
> pltPrefx = "a"
> txbScrName.Text = pltPrefx & pltTitle & pltType
> Dim TimCtr, TimX As Integer
> For TimX = 1 To 4
> If TimX = 1 Then txbScrName.BackColor = Color.Yellow
> If TimX = 2 Then txbScrName.BackColor = Color.White
> If TimX = 3 Then txbScrName.BackColor = Color.Yellow
> If TimX = 4 Then txbScrName.BackColor = Color.White
> For TimCtr = 0 To 200000
> Next 'timx
> Next ' timctr
> txbScrName.BackColor = Color.White
> End Sub
' ///
For TimX = 1 To 4
txtScrName.BackColor = CType(IIf((TimX Mod 2) = 0, Color.White,
Color.Yellow), System.Drawing.Color)
System.Threading.Thread.Sleep(1000)
Next
txtScrName.BackColor = Color.White
' ///
Untested, but give that a try
--
HTH,
-- Tom Spink, Über Geek
Woe be the day VBC.EXE says, "OrElse what?"
Please respond to the newsgroup,
so all can benefit
"Mr. B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> While at first this may seem a simple tast, it has plagued me for a
while...
>
> What I want to do is to have the background colour of something like a
TextBox
> to change from (say) White to Yellow to White to Yellow and then back to
White
> in about 1 second or so.
>
> This is to create something like a 'flash' (or a Pulse) for when a User
clicks
> on 1 of 4 Radio Buttons (which change the Text in the TextBox). So in
other
> words, to get the User's attention that the Text has Changed. Popup boxes
are
> a pain, so I don't want to go there (ie: they may click several
RadioButtons).
>
> I've tried something simple like the following to Test this out. But you
do
> not 'see' any background change happening. So obvious, I'm missing
something
> fundamental here:
>
> Private Sub rbASME1_CheckedChanged(ByVal sender As System.Object, _
> ByVal e As System.EventArgs) Handles rbASME1.CheckedChanged
> pltPrefx = "a"
> txbScrName.Text = pltPrefx & pltTitle & pltType
> Dim TimCtr, TimX As Integer
> For TimX = 1 To 4
> If TimX = 1 Then txbScrName.BackColor = Color.Yellow
> If TimX = 2 Then txbScrName.BackColor = Color.White
> If TimX = 3 Then txbScrName.BackColor = Color.Yellow
> If TimX = 4 Then txbScrName.BackColor = Color.White
> For TimCtr = 0 To 200000
> Next 'timx
> Next ' timctr
> txbScrName.BackColor = Color.White
> End Sub
>
> Anyone else done something similar? I think I tried a Timer Control a
while
> back also without success...
>
> Regards,
>
> Bruce