View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default What's the difference between Control Toolbox and Forms widget

Has VB been around 20 years or ActiveX or OLE? And I guess Jim assumes Joe
has never used a control array and knows these controls are windowless and
probably have less capability than vb6 controls. <g

anyway, the only caution I would add is Jim himself admits he lacks
familiarity with forms controls. they certainly don't have the breadth of
properties or event choices of control toolbox activeX controls, but then
they are highly accessible and very easy to code. Handling multiple controls
with a single event is trivial. They are much more compatible with use on
the spreadsheet since they are intrinsic to Excel itself. (such as dealing
with named ranges - a definite weakness with the ActiveX controls). They
each have their own collection. My opinion would be that in many instances
they are approriate, convenient and may be superior for a specialized
situation. In other situations they are not.

--
Regards,
Tom Ogilvy


"Jim Thomlinson" wrote:

If you are a VB6 developer then you will be much more familiar with the
control toolbox controls. They have properties that can be accessed by right
clicking the control and selecting properties along with all of the regular
events. You can also code against them just like you have for the past 20
years. The controls are embeded directly in the sheet and the code for the
controls ends up in the sheet (very similar to a form). For example if you
place a command button in sheet1 (code name sheet1) then you can access that
button with Sheet1.CommandButton1.Enabled = true. These are the controls that
I always use.

Controls from the forms toolbar are more like pictures of controls. The
formatting of the controls is handled through the Format menu. The contols
are much more difficult to access through code. These controls are attached
to code that is placed in a standard code module. I am hard pressed to think
of an advantage to using these controls. The only time I have used them was
when I wanted to copy a sheet out of a workbook to a new workbbok for
distribution. By using a contol from the forms toolbar there was no code left
in the sheet when I deleted the controls.
--
HTH...

Jim Thomlinson


"Joseph Geretz" wrote:

Hi,

Can you give this layman a brief rundown on the basic difference(s) between
these two types of widgets?

(I say 'layman' because I'm not an Excel developer. I am a VB6 developer, 20
years in software development, so if you want to throw some technical
details at me, I should be able to handle them. ;-)

Thanks!

- Joseph Geretz -