Not a standard feature, but you could do it by OwnerDrawing. Just set off a
timer to paint the tab in alternating colors. You will lose the VisualStyle
of the TabControl though.
A simple example:
Private flashTab As Boolean
Private TabToFlash As New ArrayList
Private WithEvents FlashTimer As New Timer
Private Sub TabControl1_Dra wItem(ByVal sender As Object, _
ByVal e As System.Windows. Forms.DrawItemE ventArgs) _
Handles TabControl1.Dra wItem
Dim backBrush As New SolidBrush(Syst emColors.Contro l)
Dim tabRect As RectangleF = _
RectangleF.op_I mplicit(Me.TabC ontrol1.GetTabR ect(e.Index))
Dim tp As TabPage = Me.TabControl1. TabPages(e.Inde x)
If tp Is Me.TabControl1. SelectedTab Then
tabRect.Inflate (2, 2)
End If
If FlashTimer.Enab led Then
If TabToFlash.Cont ains(tp) AndAlso flashTab Then
backBrush.Color = Color.Orange
End If
End If
e.Graphics.Fill Rectangle(backB rush, tabRect)
Dim sf As New StringFormat(St ringFormatFlags .NoWrap)
sf.Alignment = StringAlignment .Center
sf.LineAlignmen t = StringAlignment .Center
backBrush.Color = SystemColors.Co ntrolText
e.Graphics.Draw String(tp.Text, e.Font, backBrush, tabRect, sf)
backBrush.Dispo se()
sf.Dispose()
End Sub
Private Sub FlashTimer_Tick (ByVal sender As Object, _
ByVal e As System.EventArg s) Handles FlashTimer.Tick
flashTab = Not flashTab
TabControl1.Inv alidate()
End Sub
Private Sub TabControl1_Sel ectedIndexChang ed(ByVal sender As Object, _
ByVal e As System.EventArg s) _
Handles TabControl1.Sel ectedIndexChang ed
If TabToFlash.Cont ains(TabControl 1.SelectedTab) Then
TabToFlash.Remo ve(TabControl1. SelectedTab)
If TabToFlash.Coun t = 0 Then
FlashTimer.Stop ()
End If
TabControl1.Inv alidate()
End If
End Sub
'Example Usage
Private Sub Button1_Click(B yVal sender As System.Object, _
ByVal e As System.EventArg s) Handles Button1.Click
Static r As New Random
Dim tp As TabPage = TabControl1.Tab Pages(r.Next(Ta bControl1.TabCo unt))
If Not (TabToFlash.Con tains(tp)) AndAlso _
Not (tp Is TabControl1.Sel ectedTab) Then
TabToFlash.Add( tp)
Else
Return
End If
FlashTimer.Inte rval = 400
FlashTimer.Star t()
End Sub
--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"iwdu15" <jmmgoalsteraty ahoodotcom> wrote in message
news:5B******** *************** ***********@mic rosoft.com...
hi, this will seem like an odd question but il explain. im making an AIM
Custom Client with the SDK they released. I want to add tabbed IMs using a
tab control. I made a custom control inheriting the tab page, but im
wondering if i can flash a tab page like i can flash a window. Just have
it
flash until it gets focus, like a window once again. is this possible?
--
-iwdu15