Dynamic Reference To Userform Controls
I'm looking for a way to create a nonstandard control in a userform at runtime.
I can use the controls.add method and a progID for standard controls like labels, textboxes, etc. However, I don't know the progID for any of the controls that are not the default toolbox controls or whether they even exist.
PS: Prefer not to add hidden controls to the form in design time.
Can anyone tell me why I am getting an error on the below code? It worked if I just use Userform3.Controls("Textbox" & iCount).value = "testStr". I have a need to reference a specific userform and its objects in a sub-routine. Please advise.
iCount = 3
Controls("UserForm" & iCount).Controls("Textbox" & iCount).Value = "testStr"
Im hoping one of the VBA gurus have a solution, and Im sure this is something that has probably been tackled before (though I couldn't find on Google, might not be searching the right terms)
I have added a minimize/maximize button to the userform using these API:
The maximize button I would like to utilize, but its useless without it also resizing all of my controls (which would also require the position of the controls top/left to change as well)
So thats the question, without manually specifying the Top/Left/Width/Height (and possibly font size), how can I adjust the controls automatically proportionately to the new userform size?
In Access there is the controls collection which allows us to, among other things, loop through controls using the code
Dim ctl as Control
For each ctl in me.controls
Do your desired tasks
Is there a similar feature in Excel? If so, what reference must I activate in the Visual Basic editor?
I've found working code to make the whole form transparent (SetLayeredWindowAttributes), but I want the controls to be visible.
Does anyone know how to do this? I have no code to post for this since I have no idea...
In case there are other ideas, what I'm trying to do is create a non-rectangular userform with a picture a s a background. As far as I know it is not possible to change the shape of a userform, so my idea is to make it transparent and then add a picture with the desired shape.
I'd like to do this in VBA since I have no development environment for making COMs or dlls.
Related Applications & Scripts
This package contains several products which allow a variety of effects and controls to be added to web pages. The effects and controls allow more information to be placed within an area of a web and at the same time provide visitors with a dynamic and interactive experience.
- Active Scrolling Text
- Active Image Viewer
- Advanced Scrolling Text
- Banner Rotation
- Fading Images
- Fading Text
- Slide Show
- Sliding Text
This handy utility allows the user to take control of the playhead in your Flash presentations. Very simple to use. It doesnt matter whats in your presentation, or how long it is, the Actionscript does everything for you.
100% Vector Graphics in the controls so you can change them easily.
Need the controls to be larger/smaller? No problem, resize them and it will still function exactly as it did before.
What it is Dynamic Background
Its an easy to use component to put dynamic floating backgrounds that react to the mouse position. You can have great effects on your flash website.
How to use Dynamic Background
Just drag and drop the DynamicBackground component to your movie clip.
This is a dynamic and intuitive photo viewer driven by XML . Images and text are very easy to modify and update by changing the XML document.