472,794 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 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 2054
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.