473,657 Members | 2,486 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

flash a tab control

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
Jun 25 '06 #1
2 2385
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

Jun 25 '06 #2
just letting anyone whos interested know, that changing the back color of the
control does not change the title of the tab control like i hoped, so i used
an ImageList instead to change an image when i need to get the users
attention. just FYI
--
-iwdu15
Jun 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2456
by: Mr. B | last post by:
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...
0
2030
by: Uma Vivek | last post by:
Hi, I have a problem with Flash remoting via .NET . I seem to have all the code right, but flash does not seem to display the data at all. Here's is what Ive done so far... (1) Ive installed Flash Remoting MX, and copied over the contents of wwwroot\flashremoting\bin into my web application's folder\bin.
9
8578
by: Keith Rowe | last post by:
Hello, I am trying to reference a Shockwave Flash Object on a vb code behind page in an ASP.NET project and I receive the following error: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). On the aspx page I have the object tag as follows:
3
7668
by: VMI | last post by:
I asked this question some time ago, and I received a reply, but I never followed up on the suggestion. That's why I'm posting again... I'm trying to add a Macromedia Flash movie to my C# windows project so that I can use it as a screensaver. I was told that the easiest way would be to add a WebBrowser control to my Windows Form and then have it load the Flash movie, but I'm not sure how to do this. I have VS.Net 2005. Also, since I plan...
0
3284
by: rwakelan | last post by:
I am having a strange problem with the shockwave flash object (look at rwakelan.googlepages.com/flash.html to find out how to get it in a project). The easiest way to recreate the error is to: 1. Create a new project. 2. Add a custom control. 2a. Inside that custom control add a tab control. 2b. Add the shockwave object to the tab page. 2c. Set up the shockwave object with a movie. It will work fine here.
4
21842
by: vivek | last post by:
I am new to flash and want someone to guide me, Is it possible to create a UI entirely in Flash and that will inetract with C# components (backend) and these components will in return interact with database etc. If flash and C# interaction is possbile then, what are the prons and cons of this interaction? As using flash, one can create wonderful UI. But in return I also want it to interact fully with C# components.
3
5916
by: Tim Dixon | last post by:
Hi, Can someone tell me how to get a flash file to play in Visual Basic .net? (VS2005) Tried adding a com component to the toolbox (as it worked in VS2003), but this produces an error in 2005 (seems to be a know bug with VS2005) All I want to do is PLAY flash files - and maybe control them (ie. play, pause, send vars to/from)
3
3486
by: Tim Dixon | last post by:
Hi, Can someone tell me how to get a flash file to play in Visual Basic .net? (VS2005) Tried adding a com component to the toolbox (as it worked in VS2003), but this produces an error in 2005 (seems to be a know bug with VS2005) All I want to do is PLAY flash files - and maybe control them (ie. play, pause, send vars to/from)
115
13265
by: post2google | last post by:
I was thinking about where to go for lunch the other day, so I went to hardees.com to see what the menu looked like these days. What comes up is a big note that my flash version is not new enough so I can't use the site. What complete losers! When are businesses going to understand that the purpose of a web site is to communicate with customers or business parterns and NOT so your "web master or "web engineer" can show off what they...
4
5993
by: Anil Gupte | last post by:
Any ideas/tutorials/resources? TIA, -- Anil Gupte www.keeninc.net www.icinema.com
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.