User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 391,598 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,648 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 746 | Replies: 4 | Solved
Reply
Join Date: Sep 2007
Posts: 56
Reputation: Dell XPS is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Disable user to change tab

  #1  
May 5th, 2008
I need to prevent the user from changing tab in a tab control until it clicks on the "Finish" button on the current tab.

Thats all
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 287
Reputation: ericstenson is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 28
Colleague
ericstenson's Avatar
ericstenson ericstenson is offline Offline
Posting Whiz in Training

Re: Disable user to change tab

  #2  
May 5th, 2008
There is a property called enabled, set it to false.
--
"Dummy."
Reply With Quote  
Join Date: Sep 2007
Posts: 56
Reputation: Dell XPS is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Re: Disable user to change tab

  #3  
May 6th, 2008
yes, but that disables all the controls on the tab control! i just need to disable to change tab...
Reply With Quote  
Join Date: May 2008
Posts: 11
Reputation: danielgee is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
danielgee danielgee is offline Offline
Newbie Poster

Re: Disable user to change tab

  #4  
May 6th, 2008
Unfortunately Microsoft forgot to put in the e.Handled on a mouse event.

If you would like, you can create your own Class do deal with this. Then you just use e.Handled = True (on the TabControl MouseDown for example) and the mouse click will not get fired. I copied the code below for you:

Public Class MouseEventArgs
    Inherits System.Windows.Forms.MouseEventArgs



    Private _mHandled As Boolean

    ''' <param name="button">One of the System.Windows.Forms.MouseButtons 
    ''' values indicating which mouse button was pressed.</param>
    ''' <param name="clicks">The number of times a mouse button was pressed.</param>
    ''' <param name="x">The x-coordinate of a mouse click, in pixels.</param>
    ''' <param name="y">The y-coordinate of a mouse click, in pixels.</param>
    ''' <param name="delta">A signed count of the number 
    ''' of detents the wheel has rotated.</param>
    <DebuggerHidden()> _
    Sub New(ByVal button As MouseButtons, _
    ByVal clicks As Integer, _
    ByVal x As Integer, _
    ByVal y As Integer, _
    ByVal delta As Integer)
        MyBase.New(button, clicks, x, y, delta)
        Me._mHandled = False
    End Sub


    ''' <summary>
    ''' Gets or sets a value indicating whether the event was handled.
    ''' </summary>
    Public Property Handled() As Boolean
        <DebuggerHidden()> _
        Get
            Return Me._mHandled
        End Get
        <DebuggerHidden()> _
        Set(ByVal value As Boolean)
            Me._mHandled = value
        End Set
    End Property


End Class
Reply With Quote  
Join Date: Sep 2007
Posts: 56
Reputation: Dell XPS is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Dell XPS Dell XPS is offline Offline
Junior Poster in Training

Re: Disable user to change tab

  #5  
May 7th, 2008
ok thank you
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb VB.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 11:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC