LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default comboboxes, userforms and class modules

thanks for this help. How would it be different if my comboboxes are
in frames? do comboboxes automatically become the children of frames,
just by drawing them that way in design mode?


A control can be "in" a frame or merely physically over it. To put a control
"in" a frame, frist select the frame then add the control. It's parent is
then the frame, grandparent the form.

So, to refer to the form of a control in a frame
myInFrameControl.Parent.Parent

Some reasons to use frames - presentation, grouping sets of OptionButtons
(one can be true in each set), to process "each" control in Frame1

also, can you tell me
what the array declaration would look like?

dim clsCombos(34) as combobox?


Public clsCombos(0 to 34) as Class1 ' zero bound by default, 0-33 ?

in say the form's initialize or acitvate event

i = 0
set ctrl = Me.myFirstCombo
Set clsCombos(i) = New Class1
Set clsCombos(i) .cmbo = ctrl
i + i + 1

normally in some sort of loop where ctrl is set to the next combobox to add
to the array

If you have addded your combos sequentially at design time, and know their
index numbers, simply loop by index number. Eg you have added 10 controls
(index of the first is 0) and then added 35 combos

n = 0
for i = 10 to 44
Set clsCombos(n) = New Class1
Set clsCombos(n) .cmbo = me.controls(i)
n = n + 1
Next

At the top of Class1
Public WithEvents cmbo As MSForms.ComboBox

add events from the top right dropdown (you may need to select "cmbo" in the
middle dropdown first)

Regards,
Peter T


 
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
Basic question - modules and class modules - what's the difference? Mark Stephens[_3_] Excel Programming 9 May 8th 05 11:48 AM
Class Modules Pavlos Excel Programming 5 January 19th 05 05:31 PM
Class Modules ibeetb Excel Programming 1 January 5th 04 10:04 PM
Class Modules vs Modules Jeff Marshall Excel Programming 2 September 28th 03 07:57 PM
Delete Modules and Userforms Peter Pantus Excel Programming 1 September 26th 03 08:17 PM


All times are GMT +1. The time now is 10:29 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"