Re: How To: Colour Flash TextBox background?
From: One Handed Man \( OHM - Terry Burns \) ("One)
Date: 07/10/04
- Next message: One Handed Man \( OHM - Terry Burns \): "Re: XSLT Brain Death has occured"
- Previous message: Cor Ligthert: "Re: Currency Manager Issue."
- In reply to: Herfried K. Wagner [MVP]: "Re: How To: Colour Flash TextBox background?"
- Next in thread: Mr. B: "Re: How To: Colour Flash TextBox background?"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 10 Jul 2004 11:06:47 +0100
I normally would not have put the Try/Catch here, but when I was debugging I
was getting some exceptions.
-- OHM ( Terry Burns ) . . . One-Handed-Man . . . Time flies when you don't know what you're doing "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:epItXJfZEHA.2444@tk2msftngp13.phx.gbl... > * "One Handed Man \( OHM - Terry Burns \)" <news.microsoft.com> scripsit: > > Public Class xTimer > > Inherits Timer > > > > Public Sub New() > > MyBase.New() > > End Sub > > > > Private m_control As Control > > Public Property xControl() As Control > > Get > > Return m_control > > End Get > > Set(ByVal Value As Control) > > m_control = Value > > End Set > > End Property > > > > End Class > > > > > > // FORM > > Private WithEvents MyTimer As New xTimer > > Private FlipBackColor As Boolean = True > > > > Private Sub MyTimer_Tick(ByVal sender As Object, ByVal e As > > System.EventArgs) Handles MyTimer.Tick > > Dim tim As xTimer = DirectCast(sender, xTimer) > > Dim xText As TextBox > > Try > > xText = tim.xControl() > > If FlipBackColor Then > > xText.BackColor = Color.Red > > FlipBackColor = False > > Else > > xText.BackColor = Color.White > > FlipBackColor = True > > End If > > Catch ex As Exception > > 'TODO: > > End Try > > What exceptions are you expecting here? > > BTW: I don't see any advantages in adding the reference to the control to the timer, and then placing the > 'Tick' event handler to the form. Instead, I would extend the textbox, > instantiate the timer in the extended textbox to keep the stuff outside > the form's implementation (better encapsulation). > > -- > Herfried K. Wagner [MVP] > <URL:http://dotnet.mvps.org/>
- Next message: One Handed Man \( OHM - Terry Burns \): "Re: XSLT Brain Death has occured"
- Previous message: Cor Ligthert: "Re: Currency Manager Issue."
- In reply to: Herfried K. Wagner [MVP]: "Re: How To: Colour Flash TextBox background?"
- Next in thread: Mr. B: "Re: How To: Colour Flash TextBox background?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|