?
Solved

VB.NET Custom TabControl / TabPage

Posted on 2003-11-24
6
Medium Priority
?
3,499 Views
Last Modified: 2008-01-16
I have created my own TabPage (inherited from Windows.Forms.TabPage) and I am now attemping to create my own TabControl (inherited from Windows.Forms.TabControl) so that I can use the verbs to add and remove my own tab pages from the tabcontrol.

I sort of go the verb part working ok, however, in the designer, when I have more than 1 tab it does not allow me to click on the additional tabs.

What am I doing wrong? I believe I am missing something from my designer class because if I remove my custom designer, i can now click on the additional tabs.

Thanks
0
Comment
Question by:liebrand
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9813440
Are you overriding any of the normal behavior of the control?
0
 
LVL 15

Author Comment

by:liebrand
ID: 9813458
nope... do the following:

<Designer("MyTabControlDesigner")> _
Public Class MyTabControl
   inherits system.windows.forms.tabcontrol

end Class

Public Class MyTabControlDesigner
    inherits System.Windows.Forms.Design.ControlDesigner

End Class

And you will see that if you add tabs, you cannot select them.
0
 
LVL 15

Author Comment

by:liebrand
ID: 9814773
I figured it out ... i landed up doing the following in my designer:

        Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
            Dim p As System.Drawing.Point
            Dim n As TickerTabPage

            If m.Msg = WM_LBUTTONDOWN Then
                p = New System.Drawing.Point(m.LParam.ToInt32())

                For index As Integer = 0 To _Control.TabPages.Count - 1
                    Dim tabRec As System.Drawing.Rectangle = _Control.GetTabRect(index)
                    If (tabRec.Contains(p)) Then
                        _Control.SelectedIndex = index
                    End If
                Next
            End If
            MyBase.WndProc(m)
        End Sub
0
Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 9815384
Question closed and points refunded

PashaMod
CS Moderator
0
 

Expert Comment

by:Bharat Guru
ID: 9818806
i syour tab will work in Netscape
0
 

Expert Comment

by:brookd
ID: 22254648
Can you access a tab by name/ID,  not by the integer index?
0

Featured Post

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question