Author Topic: Telling the userform where to start at (lesson 3)  (Read 4131 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Telling the userform where to start at (lesson 3)
« on: July 18, 2006, 06:27:45 PM »
So now that I have the code written, and it seems to be working, how can I tell the userform to start in a specific place?  Save I have two text boxes (which is what I have now) labeled TextBox1 TextBox2 (how original, I know), how to tell the form, when called, to start in TextBox1?  Once I know this, I will post my finished code for all to admire throw rotten tomatoes at.  :-D

Thanks again.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Telling the userform where to start at (lesson 3)
« Reply #1 on: July 18, 2006, 06:46:16 PM »
Hint: SetFocus Method.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Telling the userform where to start at (lesson 3)
« Reply #2 on: July 18, 2006, 06:55:31 PM »
I was looking, and searching for almost an hour.  I thought there had to be some type of set focus, or start in location, but couldn't find it.  Thanks MP.  Here is my first little hybrid.  It is really simple.  It will show a dialog box with two text boxes.  If you fill them in, it will prompt you to change a text/mtext/attribute object.

Save both to a location in the search path (don't know why I'm typing this part).  After loading the lisp, type "TestVBA" to run it.

Thanks again to Michael, Jeff and Bob (no particular order) for all the help they have provided me, and James for starting me off.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Telling the userform where to start at (lesson 3)
« Reply #3 on: July 18, 2006, 08:14:06 PM »
Worked for me! Congratulations! Now to get you to step away from the ()'s....
:-D

As if I have completely, too.....  :lmao:

DaveW

  • Guest
Re: Telling the userform where to start at (lesson 3)
« Reply #4 on: July 18, 2006, 10:25:35 PM »
Are you looking for

frmMyform.top = 700
frmMyform.left = 1700

???

I usually run a sub called populate on the load event and add the positioning in the populate sub.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Telling the userform where to start at (lesson 3)
« Reply #5 on: July 19, 2006, 10:59:01 AM »
Are you looking for

frmMyform.top = 700
frmMyform.left = 1700

???

I usually run a sub called populate on the load event and add the positioning in the populate sub.
Not really.  I could of cared less where the form showed up on my screen, which is what I think you are teaching me.  MP told me the way to do what I was trying.
UserForm1.TextBox1.SetFocus
is what I was after, and couldn't find.
Thanks though.  This is a learning process for me.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Telling the userform where to start at (lesson 3)
« Reply #6 on: July 19, 2006, 11:00:16 AM »
Worked for me! Congratulations! Now to get you to step away from the ()'s....
:-D

As if I have completely, too.....  :lmao:
Thanks for testing it Jeff.  I don't know if I will be able to leave lisp, it just feel so natural now. :-D

But only time will tell.....
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

hendie

  • Guest
Re: Telling the userform where to start at (lesson 3)
« Reply #7 on: July 19, 2006, 11:46:40 AM »
... how can I tell the userform to start in a specific place?  .

You can use the TabOrder to specify the order of the controls. (under the View menu) Just set the TabStop value to False for controls you don't want to be able to jump to

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Telling the userform where to start at (lesson 3)
« Reply #8 on: July 19, 2006, 01:01:47 PM »
... how can I tell the userform to start in a specific place?  .

You can use the TabOrder to specify the order of the controls. (under the View menu) Just set the TabStop value to False for controls you don't want to be able to jump to
Thanks for the information.  Added to grey matter.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Telling the userform where to start at (lesson 3)
« Reply #9 on: July 19, 2006, 02:58:04 PM »
... MP told me the way to do what I was trying ...

Quick note Tim -- Might be a good idea before invoking setfocus to ensure an object is visible / enabled lest it chuck a wobbly. Sorry haven't had a chance to review your code (cannae d/l from here / busy).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Telling the userform where to start at (lesson 3)
« Reply #10 on: July 20, 2006, 11:08:05 AM »
... MP told me the way to do what I was trying ...

Quick note Tim -- Might be a good idea before invoking setfocus to ensure an object is visible / enabled lest it chuck a wobbly. Sorry haven't had a chance to review your code (cannae d/l from here / busy).
It's all good Michael.  Thanks for that bit of information.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.