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

Problem with tab control event

I have two tab controls (four tabpages each) and each tab control is in a
splitter panel (horiz orientation). I added a event handlers to handle the
selected tab event. The upper tab control works when every tab is selected.
The lower tab control only seems to work when the first three tabs are
selected, not the last.

Any ideas why?

Thanks,
Mark
Mar 8 '07 #1
2 8514
On Mar 7, 4:43 pm, "Mark F." <reply2gr...@nospam.comwrote:
I have two tab controls (four tabpages each) and each tab control is in a
splitter panel (horiz orientation). I added a event handlers to handle the
selected tab event. The upper tab control works when every tab is selected.
The lower tab control only seems to work when the first three tabs are
selected, not the last.

Any ideas why?

Thanks,
Mark

Mark,

I created a VS.NET 2003 WinForm project, added a panel and to the
panel a tab, a splitter (oriented as horizontally) and another tab.

I wired both tab controls to its SelectedIndexChanged event and on
clicking each TabPage in both tabs the event fired.

I then wired the TabIndexChanged event for both tabs and found that
this event didn't fire for any TabPage for either tab. I'm not sure
why, perhaps I don't understand what the event is supposed to do
exactly.

For fun (or at least what passes for fun for me these days) I had both
tabs SelectedIndex property display when the SelectedIndexChanged
events fired. I noticed that the SelectIndex was changing, yet
changing the index via a mouse click wasn't firing the TabIndexChanged
event.

I was going to post my project but saw that it would have been pretty
much illegible. If you're not using the SelectedIndexChanged event
for your tab controls, perhaps that's you're solution.

-Jay

Mar 9 '07 #2
"Jay Riggs" <ja*********@gmail.comwrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
I created a VS.NET 2003 WinForm project, added a panel and to the
panel a tab, a splitter (oriented as horizontally) and another tab.

I wired both tab controls to its SelectedIndexChanged event and on
clicking each TabPage in both tabs the event fired.

I then wired the TabIndexChanged event for both tabs and found that
this event didn't fire for any TabPage for either tab. I'm not sure
why, perhaps I don't understand what the event is supposed to do
exactly.

For fun (or at least what passes for fun for me these days) I had both
tabs SelectedIndex property display when the SelectedIndexChanged
events fired. I noticed that the SelectIndex was changing, yet
changing the index via a mouse click wasn't firing the TabIndexChanged
event.

I was going to post my project but saw that it would have been pretty
much illegible. If you're not using the SelectedIndexChanged event
for your tab controls, perhaps that's you're solution.

-Jay
Thanks Jay,

I simply wanted to display the current view (tabpage) on a statusbar pane.
private void viewsTabControl_SelectedIndexChanged(object sender, EventArgs
e)
{
sbrViewPane.Text = viewsTabControl.SelectedTab.Text;

// or ...,

// sbrViewPane.Text =
viewsTabControl.TabPages[viewsTabControl.SelectedIndex].Text;
}

I think that I found the trouble. One view is a picturebox control that
previews an image file if the user selects one. I used the OnPaint event to
draw text in the view if the user clicks the tab and no image is loaded (ie,
"No image selected"). When I commented out the Paint code block the
SelectedIndexChanged event fires normally for the preview tabpage. I still
don't know why this behavior is occurring however.

Mark


Mar 10 '07 #3

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

Similar topics

1
by: mjcast | last post by:
I have been working on an ActiveX control in C#. It is packaged in a Windows Control library and the code is in a user control. The control is used as an automation receiver that is used to update a...
11
by: Sagaert Johan | last post by:
I have made a custom control that draws a rectangle when the mouse is down, and does nothing when the mouse is up. I set/reset a flag in MouseDown/Mouse up and use this to do the drawing in the...
3
by: dan | last post by:
Hi all, I have a reflection-problem I'm totally stuck with. Maybe someone has a hint... I want to get a fieldinformation of an event from the Control class, e.g. "TextChanged". FieldInfo fi =...
1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
1
by: Lamont Adams | last post by:
Hi all, I've created numerous custom controls of varying complexity, but I've been on this problem for a day and a half, and I can't figure this mystery out. I hope one of you kind folks can...
9
by: Anders K. Jacobsen [DK] | last post by:
Hi I have this that adds some usercontrol (UCTodays.ascx) to a placeholder foreach(A a in B){ UCTodays ucline = (UCTodays )LoadControl("UCTodays.ascx");...
14
by: Altman | last post by:
Ok I have a control that is inherited from another class. In the child I put msgbox(me.name) in the load event. What always pops up is the name of the parent class and not the name of the...
1
by: clickon | last post by:
For testing purposes i have got a 2 step WizardControl. Eqach step contains a text box, TextBox1 and TextBox2 respectively. If i put the following code in the respective activate event handlers for...
6
by: Joel | last post by:
2 Questions: (1) The documentation says application.run() creates a standard message loop on the current thread and "optionally" shows a form. This is really confusing because I was of the...
6
by: Funky | last post by:
Hello! I have a problem. I have to change the size of a control added to a Form when the user resizes the Form. I use the Resize event and change the size of the control in the method which is...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
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...

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.