Loading UserForm?

Discussion in 'AutoCAD' started by Jade, Jun 1, 2004.

  1. Jade

    Jade Guest

    Hi

    I am making a "About" dialog box in my ACAD menu
    Two easy questions;

    1. I have a UserForm (pretty basic with graphic text area and OK button).
    When i run the form in VBE, it runs in ACAD ok. The OK button unloads when
    I click it....great...but I am unsure how to run my UserForm from my menu or
    can I do that?

    2. I can't seem to figure out how to apply a url address when I select a
    button.

    Any suggestions

    Thanks for the help...

    Jade
     
    Jade, Jun 1, 2004
    #1
  2. Jade

    Warren M Guest

    Hello Jade.

    You need to create a 'wrapper' sub that will call the form.

    i.e.

    Public Sub ShowAbout

    frmAbout.Show

    End Sub

    Then you call the ShowAbout macro from the menu.

    Hope this helps
    Warren M


    Message was edited by: Warren M
     
    Warren M, Jun 1, 2004
    #2
  3. Jade

    Ed Jobe Guest

    Here's my answer to #2:

    Public Sub Browse(Optional URL As String, Optional winstyle As VbAppWinStyle)
    'opens IE in last WinStyle if WinStyle is not supplied

    'Nav to home page if url is blank
    If Not URL = "" Then URL = " " & URL
    'make sure your path to IE is correct
    Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE" & URL, winstyle
    End Sub


    --
    ----
    Ed
    ----
    Hi

    I am making a "About" dialog box in my ACAD menu
    Two easy questions;

    1. I have a UserForm (pretty basic with graphic text area and OK button).
    When i run the form in VBE, it runs in ACAD ok. The OK button unloads when
    I click it....great...but I am unsure how to run my UserForm from my menu or
    can I do that?

    2. I can't seem to figure out how to apply a url address when I select a
    button.

    Any suggestions

    Thanks for the help...

    Jade
     
    Ed Jobe, Jun 1, 2004
    #3
  4. Jade

    Jade Guest

    Hi Warren

    Tried your suggestion....this is what I have in my form....but i am getting
    a 424 error
    ___________________________
    Private Sub TextBox1_Change()

    End Sub

    Private Sub cmdClose_Click()
    Unload Me
    End Sub

    Private Sub Image1_Click()

    End Sub

    Private Sub Label1_Click()

    End Sub
    _______________________________

    I made a Macro called it "About" (Module1)

    and put your suggested item in there but I am getting a 424 error @
    frmAbout.Show
    ______________________
    Public Sub About()
    frmAbout.Show
    End Sub
    ___________________

    Thanks for the help

    J
     
    Jade, Jun 1, 2004
    #4
  5. Jade

    Jürg Menzi Guest

    Jade

    You've to load the form first:
    ' -----
    Public Sub About()

    Load frmAbout
    frmAbout.Show

    End Sub
    ' -----

    Cheers
     
    Jürg Menzi, Jun 1, 2004
    #5
  6. Jade

    Jade Guest

    How do you load the form first? Using your suggestion I still get 424
    error...

    in VBE i have..


    Forms>About
    Private Sub TextBox1_Change()

    End Sub

    Private Sub cmdClose_Click()
    Unload Me
    End Sub

    Private Sub Image1_Click()

    End Sub

    Private Sub Label1_Click()

    End Sub


    Modules>Module1
    Public Sub Test()

    Load frmAbout
    frmAbout.Show

    End Sub

    Thanks for the help!

    J
     
    Jade, Jun 1, 2004
    #6
  7. Jade

    Jade Guest

    Thanks Juerg that worked 8)
     
    Jade, Jun 1, 2004
    #7
  8. Jade

    Jürg Menzi Guest

    Jade

    Seems your form name is 'About' and not 'frmAbout'. In this case
    you've to call the correct name:

    Public Sub Test()

    Load About
    About.Show

    End Sub

    Cheers
     
    Jürg Menzi, Jun 1, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.