Jump to content

VBA menu


Recommended Posts

Ver 2008,


Is it possable to make a user form that would pull up at the bottom

edge of your screen. On the user form that pulls up have buttons to pull

and run other CAD VBA or lisp projects? Something simular to tools bar but without icons. Some thing that uses userform in a single VBA program. Does anyone have a sample of that?

thank you,

Link to comment
Share on other sites

I use a popup form that I call to mimic how some programs popup from the startbar in Windows. With some massaging, you may get it to do what you want. Create a form with a timer control and a label and copy the code into the form. Call the form with formPopUp.show (or whatever you call the form).


Dim DirectionIsUp As Boolean ' Up is True, Down is False

Private Sub Form_Load()
 'Move it below the visible screen (and a little just in case)
 Me.Top = Screen.Height + 10
 'Move it to the far right of the visible screen (minus a little, just for esthetics)
 Me.Left = Screen.Width - (Me.Width + 100)
 'We're gonna move it up
 DirectionIsUp = True
 Me.Label1.Caption = "FINISHED"
End Sub

Private Sub Timer1_Timer()
 'Move at 10 millisecond intervals (100 times a second, 3 times what the eye can see)
 Timer1.Interval = 10
 ' If it's moving up
 If DirectionIsUp Then
   'Move it up 50 twips every 10 milliseconds
   Me.Top = Me.Top - 50
   'Move until the whole form is shown (minus 10 twips to make sure it still touches the bottom of the screen)
   If (Me.Top <= Screen.Height - (Me.Height - 10)) Then
     ' This specifies how long it will stay shown (Unmoving)
     Timer1.Interval = 3000
     ' We're gonna move it down next...
     DirectionIsUp = False
   End If
   'Move it down 50 twips every 10 milliseconds
   Me.Top = Me.Top + 50
   'Move until the whole form is shown (plus 10 twips to make sure it's hidden)
   If Me.Top >= Screen.Height + 10 Then
     Timer1.Enabled = False
     Unload Me
   End If
 End If
End Sub

Link to comment
Share on other sites

I have some starter code that mimics a tool palette, in VBA, if someone will show me how to attach files to a post ...


look at the picture:

During reply: follow the order of the numbers.


Link to comment
Share on other sites

This basically starts with a basic VBA Form, and Frame, and turns it into a simple tool palette. I've only coded it to dock, and minimize, left. if someone else wants to take the ball and run with it, go right ahead.


When you load this in the IDE, you will see a simple VBA form with a frame. When the control is initialized, it moves this frame to the side, and top, of the window and creates a toolbar running down the side.

It uses whatever you put in for a Userform.caption as the caption.

It creates a "Slide In" and "Slide Out" arrow on the bottom of the toolbar, and a close "X" button on the toop of the toolbar.


The trick here is to put anything you want to program for inside the supplied frame. You dont have to align the frame, or anything like that, and whatver size the frame is, at design time, will be the size at run time. It *wil be moved to the left, and the form will be shrunk, around the frame at run time.



I usually drop a multi-page control on the frame, for greatest flexibility.



It uses the AcFocus Control from Autodesk so you can use Text Boxes on the ; and it uses the "wingdings3" font for the resize arrows.

You wanna get creative with the arrows? change the font. However,

It checks for the letter "t" and "u" (which just happen to be the wingdings font for the arrows) to see if the palette should be slid inwards or outwards. if you change the font, change the letters it is looking for.


I know, these letters should be listed as constants, so the can be changed easily, so sue me.


If anyone knows a workaround for using TYPES in a form module, id like to hear about it. That is the only reason the API calls are not listed within the form module....


Link to comment
Share on other sites

I exported, and reimported the code, to shrink the dvb before uploading. The file above does not have the reference for the acFocus control. if you dont know how to add this, the file attached here is the same as above, but with the file reference attached...


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...