search
Japanese Chinese Nederlands Espanol Italiano Deutsch Francais Twitter Rss Feeds
.NET Framework GroupsView
Deployment Server
.NET Distributed_Apps
.NET
.NET ADO.NET
.NET ASP.NET
.NET ASP.NET Security
.NET ASP.NET Webcontrols
.NET ASP.NET Web Services
.NET Clr
.NET Compact Framework
.NET Drawing
.NET Interop
.NET Micro Porting
.NET Performance
.NET Web Services
.NET Windows Forms
.NET Windows Forms Controls
.NET General
.NET Csharp
.NET Visual Basic
.NET Vc
.NET Security
.NET Xml
Scripting Jscript
Scripting Visual Basicscript
Scripting Wsh
Smartphone Developer
Visual Basic Com
Visual Basic Controls
Visual Basic Crystal
Visual Basic Database Ado
Visual Basic Syntax
Visual Basic Vista Compatibility
Visual Basic Winapi
Vc Atl
Vc Debugger
Vc Language
Vc Mfc
Vc Stl
Visio Developer Visual Basica
Vsnet Debugging
Windows Powershell
Windowsce Embedded Vc
Xml
Xsl

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Application Development
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft NET Csharp Posts  Ask A New Question 

Problem with tab control event - Mark F.

Wednesday, March 07, 2007 7:43 PM

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
reply
 

Problem with tab control event - Jay Riggs

Friday, March 09, 2007 4:09 PM

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
reply

Problem with tab control event - Mark F.

Saturday, March 10, 2007 10:36 AM

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,
SelectedIndexChanged event fires normally for the preview tabpage. I still
don't know why this behavior is occurring however.

Mark
reply

Previous Microsoft NET Csharp conversation.