473,625 Members | 2,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help, TabControl1_Sel ectedIndexChang ed fires on form initialize

Hello all. Please please help me come up with a solution to this
problem.
Here it goes-
--- code snipit---

'TabControl1
'
Me.TabControl1. Anchor = System.Windows. Forms.AnchorSty les.Left
Me.TabControl1. Controls.AddRan ge(New
System.Windows. Forms.Control()
{Me.TabPage1, Me.TabPage2, Me.TabPage3})
Me.TabControl1. Enabled = False
Me.TabControl1. Location = New System.Drawing. Point(0, 40)
Me.TabControl1. Name = "TabControl 1"
Offending Line---->>>>> Me.TabControl1. SelectedIndex = 0
Me.TabControl1. Size = New System.Drawing. Size(640, 384)
Me.TabControl1. TabIndex = 3
---------------------------------
When this control gets initialized it sets the selected index to 0,
thus firing the following code-

----------------
Private Sub TabControl1_Sel ectedIndexChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles TabControl1.Sel ectedIndexChang ed

Do your stuff here...

End Sub
------------

I do NOT want anything to happen when the form is initializing. How
can I catch this or stop it from happening?
I've tried to delete the offending line, but it comes back :o) ...
Any ideas?
To recreate,
Add tabcontrol to form, add a page or more to the tabcontrol.
Set the selected index changed event.
Run :o)

THANKS!
Jeff C.
Nov 20 '05 #1
2 3634
\\\
Private Sub TabControl1_Sel ectedIndexChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles TabControl1.Sel ectedIndexChang ed

Static FirstChange as Boolean = True
If FirstChange = True then
FirstChange=Fal se
Return
End If
Do your stuff here...

End Sub
///

"Jeff C" <uj*****@mail.c rk.umn.edu> wrote in message
news:ea******** *************** ***@posting.goo gle.com...
Hello all. Please please help me come up with a solution to this
problem.
Here it goes-
--- code snipit---

'TabControl1
'
Me.TabControl1. Anchor = System.Windows. Forms.AnchorSty les.Left
Me.TabControl1. Controls.AddRan ge(New
System.Windows. Forms.Control()
{Me.TabPage1, Me.TabPage2, Me.TabPage3})
Me.TabControl1. Enabled = False
Me.TabControl1. Location = New System.Drawing. Point(0, 40)
Me.TabControl1. Name = "TabControl 1"
Offending Line---->>>>> Me.TabControl1. SelectedIndex = 0
Me.TabControl1. Size = New System.Drawing. Size(640, 384)
Me.TabControl1. TabIndex = 3
---------------------------------
When this control gets initialized it sets the selected index to 0,
thus firing the following code-

----------------
Private Sub TabControl1_Sel ectedIndexChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles TabControl1.Sel ectedIndexChang ed

Do your stuff here...

End Sub
------------

I do NOT want anything to happen when the form is initializing. How
can I catch this or stop it from happening?
I've tried to delete the offending line, but it comes back :o) ...
Any ideas?
To recreate,
Add tabcontrol to form, add a page or more to the tabcontrol.
Set the selected index changed event.
Run :o)

THANKS!
Jeff C.

Nov 20 '05 #2
Tricky tricky tricky :o)
Thanks,
I'll have to remember that loop with the static declaration.

Thank you very!!! much
Jeff

"Mick Doherty" <EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in message news:<ub******* *******@tk2msft ngp13.phx.gbl>. ..
\\\
Private Sub TabControl1_Sel ectedIndexChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles TabControl1.Sel ectedIndexChang ed

Static FirstChange as Boolean = True
If FirstChange = True then
FirstChange=Fal se
Return
End If
Do your stuff here...

End Sub
///

"Jeff C" <uj*****@mail.c rk.umn.edu> wrote in message
news:ea******** *************** ***@posting.goo gle.com...
Hello all. Please please help me come up with a solution to this
problem.
Here it goes-
--- code snipit---

'TabControl1
'
Me.TabControl1. Anchor = System.Windows. Forms.AnchorSty les.Left
Me.TabControl1. Controls.AddRan ge(New
System.Windows. Forms.Control()
{Me.TabPage1, Me.TabPage2, Me.TabPage3})
Me.TabControl1. Enabled = False
Me.TabControl1. Location = New System.Drawing. Point(0, 40)
Me.TabControl1. Name = "TabControl 1"
Offending Line---->>>>> Me.TabControl1. SelectedIndex = 0
Me.TabControl1. Size = New System.Drawing. Size(640, 384)
Me.TabControl1. TabIndex = 3
---------------------------------
When this control gets initialized it sets the selected index to 0,
thus firing the following code-

----------------
Private Sub TabControl1_Sel ectedIndexChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles TabControl1.Sel ectedIndexChang ed

Do your stuff here...

End Sub
------------

I do NOT want anything to happen when the form is initializing. How
can I catch this or stop it from happening?
I've tried to delete the offending line, but it comes back :o) ...
Any ideas?
To recreate,
Add tabcontrol to form, add a page or more to the tabcontrol.
Set the selected index changed event.
Run :o)

THANKS!
Jeff C.

Nov 20 '05 #3

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

Similar topics

5
6198
by: Pierre | last post by:
Hi, I create an dynamic command button like that: buttonCmd= New Button buttonCmd.ID = "IDBTN1" buttonCmd.Text = "Test" AddHandler buttonCmd.Click, AddressOf MessageClick I have this click sub: Sub MessageClick(ByVal sender As Object, ByVal e As System.EventArgs) 'Do something End Sub
3
2253
by: cdj | last post by:
Hi all, I've got a tabControl, initially with one tabPage, along with two buttons, one to add another tabPage, and one to delete the current (selected) tabPage. On each tabPage, when it is created, is an pictureBox. Other stuff on the form leads to the creation of a graphic, say myImage, which I would like to assign to the pictureBox.Image property
9
7264
by: HL | last post by:
I am using VS 2005 Beta - C# Problem: The Timer fires a few milliseconds before the actual Due-Time Let's say a timer is created in the following manner: System.Threading.Timer m_timer = null; Let's declare a constant Int32 m_TimePeriod = 10000;
19
3472
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use the Page_Unload - event to clean up the Session variables, but when it turns out that it fires before the end, it screws up the code, and
1
1336
by: Viktor Popov | last post by:
Hi , I have a form in which I show UserInfo from the DataBase using Stored Procedure and I populate 5 TextBox controls with this information in this way: private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here SqlConnection conn = new SqlConnection("Data Source=BLEK;Initial Catalog=Estate; User ID=haha; Password=*******"); SqlDataAdapter dad = new SqlDataAdapter("prRTUSERINFO", conn);
16
2000
by: Allen | last post by:
I have a class that returns an arraylist. How do I fill a list box from what is returned? It returns customers which is a arraylist but I cant seem to get the stuff to fill a list box. I just learning and really need some help bad. Public Shared Function GetAll() As ArrayList Dim dsCustomer As New DataSet() Dim sqlQuery As String = "SELECT Name, Address, PhoneNo " & _ "FROM CustomerTable" Try
2
2208
by: Hexman | last post by:
Off on another journey through vb.net. What I want to do now is have a tab-control with 1 to 8 tab-pages for categories. I've read where there is not a hide method so I guess I'll have to tabpage.remove and tabpage.add at execution time. On each tab-page I will have a datagrid (parent) and a couple of other controls (radio buttons, labels, checkboxes, etc). Below the tab-control will be a datagrid showing related data (child info)...
0
5557
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
3
1594
by: Robert Dufour | last post by:
I am trying to localize a very simple web site (english and french) I have a master page and one content page for now. On the master page I have placed a Localize control On the content page I have placed a label and a dropdownlist. The label says "Use this language" or "Utilisez cette laague" The dropdownlist Contains values "en-US" text Englsih Us and "fr-CA" text "French Canada)
0
8189
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,...
1
8354
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
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...
0
7182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4192
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2621
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
1499
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.