+ Reply to Thread
Results 1 to 6 of 6

shape object on a userform?

  1. #1
    Alan Ibbotson
    Guest

    shape object on a userform?

    I want to create a UserForm1. On the UserFrom I want to create a Trapazoid
    shape object and three text boxes. The text boxes would define the trapazoid
    height and both lengths. When the user inputs a new number in the text box
    the trapazoid shape would change size.

    Is this possible?

    If I could get the shape drawn on the UserForm I believe I could code the
    rest. TIA.

    Alan



  2. #2
    Vasant Nanavati
    Guest

    Re: shape object on a userform?

    It is not trivial to draw on a UserForm. It may be possible to do with some
    complicated API programming, but there is no direct way to do it.

    --

    Vasant


    "Alan Ibbotson" <[email protected]> wrote in message
    news:[email protected]...
    > I want to create a UserForm1. On the UserFrom I want to create a Trapazoid
    > shape object and three text boxes. The text boxes would define the

    trapazoid
    > height and both lengths. When the user inputs a new number in the text box
    > the trapazoid shape would change size.
    >
    > Is this possible?
    >
    > If I could get the shape drawn on the UserForm I believe I could code the
    > rest. TIA.
    >
    > Alan
    >
    >




  3. #3
    Patrick Molloy
    Guest

    RE: shape object on a userform?

    As Vasant says, you can't draw, but you might get away with using a control,
    lile a label

    Private Sub CommandButton1_Click()
    Label1.Width = TextBox1
    Label1.Height = TextBox2
    End Sub

    Private Sub UserForm_Initialize()
    TextBox1.Text = Label1.Width
    TextBox2.Text = Label1.Height
    End Sub




    "Alan Ibbotson" wrote:

    > I want to create a UserForm1. On the UserFrom I want to create a Trapazoid
    > shape object and three text boxes. The text boxes would define the trapazoid
    > height and both lengths. When the user inputs a new number in the text box
    > the trapazoid shape would change size.
    >
    > Is this possible?
    >
    > If I could get the shape drawn on the UserForm I believe I could code the
    > rest. TIA.
    >
    > Alan
    >
    >
    >


  4. #4
    Vasant Nanavati
    Guest

    Re: shape object on a userform?

    Hi Patrick:

    If I understood the OP correctly, a trapezoid has angled lines, so I don't
    think a Label control would work.

    Regards,

    Vasant

    "Patrick Molloy" <[email protected]> wrote in message
    news:[email protected]...
    > As Vasant says, you can't draw, but you might get away with using a

    control,
    > lile a label
    >
    > Private Sub CommandButton1_Click()
    > Label1.Width = TextBox1
    > Label1.Height = TextBox2
    > End Sub
    >
    > Private Sub UserForm_Initialize()
    > TextBox1.Text = Label1.Width
    > TextBox2.Text = Label1.Height
    > End Sub
    >
    >
    >
    >
    > "Alan Ibbotson" wrote:
    >
    > > I want to create a UserForm1. On the UserFrom I want to create a

    Trapazoid
    > > shape object and three text boxes. The text boxes would define the

    trapazoid
    > > height and both lengths. When the user inputs a new number in the text

    box
    > > the trapazoid shape would change size.
    > >
    > > Is this possible?
    > >
    > > If I could get the shape drawn on the UserForm I believe I could code

    the
    > > rest. TIA.
    > >
    > > Alan
    > >
    > >
    > >




  5. #5
    Andy Pope
    Guest

    Re: shape object on a userform?

    Hi,

    As the other guys have said it's not straightforward.
    But you may find you can make use of the techniques I use in my example.
    http://www.andypope.info/vba/userformdraw.htm

    Cheers
    Andy

    Alan Ibbotson wrote:
    > I want to create a UserForm1. On the UserFrom I want to create a Trapazoid
    > shape object and three text boxes. The text boxes would define the trapazoid
    > height and both lengths. When the user inputs a new number in the text box
    > the trapazoid shape would change size.
    >
    > Is this possible?
    >
    > If I could get the shape drawn on the UserForm I believe I could code the
    > rest. TIA.
    >
    > Alan
    >
    >


    --

    Andy Pope, Microsoft MVP - Excel
    http://www.andypope.info

  6. #6
    Vasant Nanavati
    Guest

    Re: shape object on a userform?

    That's awesome stuff, Andy!

    Regards,

    Vasant

    "Andy Pope" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > As the other guys have said it's not straightforward.
    > But you may find you can make use of the techniques I use in my example.
    > http://www.andypope.info/vba/userformdraw.htm
    >
    > Cheers
    > Andy
    >
    > Alan Ibbotson wrote:
    > > I want to create a UserForm1. On the UserFrom I want to create a

    Trapazoid
    > > shape object and three text boxes. The text boxes would define the

    trapazoid
    > > height and both lengths. When the user inputs a new number in the text

    box
    > > the trapazoid shape would change size.
    > >
    > > Is this possible?
    > >
    > > If I could get the shape drawn on the UserForm I believe I could code

    the
    > > rest. TIA.
    > >
    > > Alan
    > >
    > >

    >
    > --
    >
    > Andy Pope, Microsoft MVP - Excel
    > http://www.andypope.info




+ 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