473,394 Members | 1,642 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,394 software developers and data experts.

TabControl - Suppress Event on Load


Dear Group

Just wondered whether you have any advice on the following?

I have a form with a TabControl and when the form loads, the
SelectedIndexChanged event is fired. Is there any chance to suppress
this event when the form loads but enable it once the form has finished
loading?

I'm very grateful for any hints as I've wasted two days so far on
finding a solution.

Many thanks for your time and efforts!
Have a nice day!

Martin

Jul 22 '05 #1
2 2088
remove the 'Handles MyTabControl.SelectedIndexChanged' from the end of the
sub and add

AddHandler MyTabControl.SelectedIndexChanged, AddressOf
MyTabControl_SelectedIndexChanged

to Form_Load()

or alternatively, add a Static flag to the event so that it ignores the
first change.

\\\
Sub MyTabControl_SelectedIndexChanged(...) Handles ...
Static FirstChange As Boolean = False
If FirstChange = False then
FirstChange = True
Return
End If
'Your code here
End Sub
///

This does not happen in C# because the handler is added in the Forms
InitializeComponent Method.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
<th************@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...

Dear Group

Just wondered whether you have any advice on the following?

I have a form with a TabControl and when the form loads, the
SelectedIndexChanged event is fired. Is there any chance to suppress
this event when the form loads but enable it once the form has finished
loading?

I'm very grateful for any hints as I've wasted two days so far on
finding a solution.

Many thanks for your time and efforts!
Have a nice day!

Martin

Jul 22 '05 #2
Thanks so much Nick! That's great!

Jul 22 '05 #3

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

Similar topics

5
by: Tamir Khason | last post by:
How be able to manage more deeply UI of TabControl and TabPage For example - I want to manage border color, change color of TabPage reef, eliminate spaces from both sides of the reef, so I bould...
2
by: Bob Trabucco | last post by:
Hello, I need to be able to intercept a TabControl BEFORE it switchs pages and do some things. There doesn't appear to be an event for that in the Compact Framework using VB.NET. Yes I know...
1
by: amber | last post by:
Hello I'm curious as to why the following would happen I have 4 forms that I'm dealing with. On form4 is a tabcontrol (we'll call it tab1) When form1 is opened, and OK is pressed, form2 opens,...
9
by: Michael Turner | last post by:
Hi Guys Having problem with the tab control, I need to set the background color to something different than the standard, I have found code on the web and now can redraw the tabpage buttons so...
5
by: Alien2_51 | last post by:
I have a problem with a ListBox control that is on a TabControl, it seems to be forgetting which items are selected in the list when I tab off the current tab, here's my winform code... I even...
1
by: theintrepidfox | last post by:
Dear Group I wonder if you can help me with the following. I have a form(Form2) that contains a tabcontrol. If I click 'Tab2' Form3 should be displayed and 'Form2' closed. The instruction to...
2
by: theintrepidfox | last post by:
Dear Group Just wondered whether you have any advice on the following? I have a form with a TabControl and when the form loads, the SelectedIndexChanged event is fired. Is there any chance to...
2
by: Simon Verona | last post by:
I have a few hundred forms in my application. All are based on a custom base form class. I decided that I wanted to globally change the look and feel of many of the controls in my application -...
2
by: =?Utf-8?B?TW9oc2luIEtoYW4=?= | last post by:
Hi, I am working on a website where i am creating Horizontal Menus Dynamically from database as per rights available to the user. I have several UserControls. And the Menu control also brings...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.