+ Reply to Thread
Results 1 to 3 of 3

CONTROLING A PAGE IN MULTIPAGE

Hybrid View

  1. #1
    michael sofianos
    Guest

    CONTROLING A PAGE IN MULTIPAGE

    hello my friends,

    I have a multipage with 5 pages. I have make button to change page forward
    or backward.
    How i can disable the events of mouse click who change page in a
    multipage.


    Thanks



  2. #2
    Dave Peterson
    Guest

    Re: CONTROLING A PAGE IN MULTIPAGE

    Maybe you can disable the other pages so the users can't select them except by
    using your buttons:

    Option Explicit
    Private Sub CommandButton1_Click()
    Dim NextPage As Long
    Dim iCtr As Long

    NextPage = Me.MultiPage1.Value + 1

    If NextPage = Me.MultiPage1.Pages.Count Then
    NextPage = 0
    End If

    For iCtr = 0 To Me.MultiPage1.Pages.Count - 1
    Me.MultiPage1.Pages(iCtr).Enabled = CBool(NextPage = iCtr)
    Next iCtr

    Me.MultiPage1.Value = NextPage

    End Sub

    Private Sub CommandButton2_Click()
    Dim PrevPage As Long
    Dim iCtr As Long

    PrevPage = Me.MultiPage1.Value - 1

    If PrevPage = -1 Then
    PrevPage = Me.MultiPage1.Pages.Count - 1
    End If

    For iCtr = 0 To Me.MultiPage1.Pages.Count - 1
    Me.MultiPage1.Pages(iCtr).Enabled = CBool(PrevPage = iCtr)
    Next iCtr

    Me.MultiPage1.Value = PrevPage

    End Sub

    Private Sub UserForm_Initialize()
    Dim iCtr As Long
    For iCtr = 0 To Me.MultiPage1.Pages.Count - 1
    Me.MultiPage1.Pages(iCtr).Enabled = CBool(iCtr = 0)
    Next iCtr
    End Sub

    (You could also hide the tabs by using .visible instead of .enabled.)



    michael sofianos wrote:
    >
    > hello my friends,
    >
    > I have a multipage with 5 pages. I have make button to change page forward
    > or backward.
    > How i can disable the events of mouse click who change page in a
    > multipage.
    >
    > Thanks


    --

    Dave Peterson

  3. #3
    michael sofianos
    Guest

    Re: CONTROLING A PAGE IN MULTIPAGE

    Thank you very match
    it's work perfect



    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Maybe you can disable the other pages so the users can't select them
    > except by
    > using your buttons:
    >
    > Option Explicit
    > Private Sub CommandButton1_Click()
    > Dim NextPage As Long
    > Dim iCtr As Long
    >
    > NextPage = Me.MultiPage1.Value + 1
    >
    > If NextPage = Me.MultiPage1.Pages.Count Then
    > NextPage = 0
    > End If
    >
    > For iCtr = 0 To Me.MultiPage1.Pages.Count - 1
    > Me.MultiPage1.Pages(iCtr).Enabled = CBool(NextPage = iCtr)
    > Next iCtr
    >
    > Me.MultiPage1.Value = NextPage
    >
    > End Sub
    >
    > Private Sub CommandButton2_Click()
    > Dim PrevPage As Long
    > Dim iCtr As Long
    >
    > PrevPage = Me.MultiPage1.Value - 1
    >
    > If PrevPage = -1 Then
    > PrevPage = Me.MultiPage1.Pages.Count - 1
    > End If
    >
    > For iCtr = 0 To Me.MultiPage1.Pages.Count - 1
    > Me.MultiPage1.Pages(iCtr).Enabled = CBool(PrevPage = iCtr)
    > Next iCtr
    >
    > Me.MultiPage1.Value = PrevPage
    >
    > End Sub
    >
    > Private Sub UserForm_Initialize()
    > Dim iCtr As Long
    > For iCtr = 0 To Me.MultiPage1.Pages.Count - 1
    > Me.MultiPage1.Pages(iCtr).Enabled = CBool(iCtr = 0)
    > Next iCtr
    > End Sub
    >
    > (You could also hide the tabs by using .visible instead of .enabled.)
    >
    >
    >
    > michael sofianos wrote:
    >>
    >> hello my friends,
    >>
    >> I have a multipage with 5 pages. I have make button to change page
    >> forward
    >> or backward.
    >> How i can disable the events of mouse click who change page in a
    >> multipage.
    >>
    >> Thanks

    >
    > --
    >
    > Dave Peterson




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1