LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding "additional" controls programatically

Looking at the object browser would be what I would do.

--
Regards,
Tom Ogilvy

"Doug Glancy" wrote in message
...
Tom,

That makes sense. Is there any way to know what properties it's inherited
besides trial and error? I guess doing what I did - declaring both as
Control/OleObject and the specific control is one way to figure it out.

Thanks,

Doug

"Tom Ogilvy" wrote in message
...
think of it this way.

When in a userform, an MSforms control is in the control container and
inherits those properties such as an exit event and a top property. In a
worksheet, it gets some properties and events from the oleobject
container.

--
Regards,
Tom Ogilvy

"Doug Glancy" wrote in message
...
Thanks Andy,

When I looked in the Object Browser, I can see that it's true for the
other MSForms controls as well.

Doug

"Andy Pope" wrote in message
...
Hi Doug,

If you go to the Object Browser (F2) and in the libraries dropdown
restrict the search to MSForms you will see the CommandButton does not
appear to have the property Top. I have no idea why but as it's not
exposed here I can understand why intellisense does not know about it.

Cheers
Andy

Doug Glancy wrote:
Andy,

Your post reminded me that even though Intellisense doesn't show a
property for a control, e.g., ".top" it might still be available. I
do wonder though, why "top" didn't show for my earlier example of an
MSForms.Button, but did when I cast it as a Control? Anyways, a good
reminder not to rely too much on the IDE features, although generally
I'd be lost without them.

Doug

"Andy Pope" wrote in message
...

Hi,

This works for me. Adds progress bar to userform and when the form is
clicked will do a simple 1 to 100 prorgess.

Private m_objPBar As Object
Private Sub UserForm_Click()

Dim lngIndex As Long
Dim lngLoop As Long

m_objPBar.Value = 0
For lngIndex = 1 To 100
For lngLoop = 1 To 599999
Next
m_objPBar.Value = m_objPBar.Value + 1
Next

End Sub
Private Sub UserForm_Initialize()

Set m_objPBar = _
Me.Controls.Add("MSComctlLib.ProgCtrl.2", "myProg", True)

With m_objPBar
.Top = 5
.Left = 5
.Width = Me.InsideWidth - 10
.Height = 15
.Value = 0
End With

End Sub

Cheers
Andy

What-A-Tool wrote:

"Bob Phillips" wrote in message
. ..


If you want a progress bar, as you note there is no built-in control
(there may be commercial controls, but I know of none), but you
could just add the usual type of progress indicator as described
here
http://www.enhanceddatasystems.com/E...rogressBar.htm

--
---
HTH

Bob



So you are saying there is no way to programatically add the
Microsoft ProgressBar Control, Version 5.0 or Version 6.0, that I
have available in the "Addtional Controls" dialog box accesible from
the tools menu? These controls are contained in comctl32.ocx, or
MSCOMCTL.OCX, respectively. Is there a way to programatically create
a reference to 1 of these .ocx files, and add the control from there?

Thanks Bob -
Sean









 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding data only if adjacent to cell labeled "male"/"female" lovesrubbaducky Excel Worksheet Functions 1 November 23rd 09 05:49 PM
Help neededin adding an additional "Warning Flag" to my current lo Danny Boy Excel Worksheet Functions 1 June 10th 09 02:50 PM
Programatically adding macro to Excel - "ThisWorkbook" Aerojade Excel Discussion (Misc queries) 3 October 1st 08 12:53 PM
CommandBars("Worksheet Menu Bar").Controls("Tools").Enabled = Fals Arturo Excel Programming 3 May 26th 05 05:44 PM
Can ActiveX controls be "disabled" and "enabled"? William DeLeo Excel Programming 1 May 7th 04 09:10 PM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"