Create controls in a form at runtime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to create a new control (any control type) on an loaded form
at runtime?
The only way i found so far is the Createcontrol method but it works only in
form's design mode.
 
"Panteliadis Babis" <Panteliadis
Is there any way to create a new control (any control type) on an loaded form
at runtime?
The only way i found so far is the Createcontrol method but it works only in
form's design mode.

No! Creating controls is a design time operation.

The way to deal with this is to precreate a bunch of
invisible controls on the form and make the visible as
needed. Besides, this is easier than creating new conrols
would be if you could do it.
 
Thanks marsh
well, This is the technique i wanted to replace and I thought , let's give
it a try !!
Do you think that should we attend to MS for a feature version ?
Consider this: You have a picture or a map, and you want dynamicaly to
create rectangle areas that you want to connect with a table (a small geo
system)
 
Panteliadis said:
Thanks marsh
well, This is the technique i wanted to replace and I thought , let's give
it a try !!
Do you think that should we attend to MS for a feature version ?
Consider this: You have a picture or a map, and you want dynamicaly to
create rectangle areas that you want to connect with a table (a small geo
system)


Well, sure, go ahead and smack MS up side the head to get
them to implement whatever you want. After all, if VB can
do it, why not Access?

Personally, I doubt that they would even consider it,
because of the way had to process the unique functionality
that Access forms provide.

As for your map example, I would prefer to be able to draw
lines, circles, etc and have more general mouse events.
But, most of what you're wishing for is already available
via transparent command buttons along with the mouse down/up
events, it's just a little tedious to code.
 
From: Panteliadis Babis ([email protected])
-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
From: Marshall Barton ([email protected])
Date: 2004-09-28 07:03:05 PST

No! Creating controls is a design time operation.

The way to deal with this is to precreate a bunch of
invisible controls on the form and make the visible as
needed. Besides, this is easier than creating new conrols
would be if you could do it.

Marsh
MVP [MS Access]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
From: Panteliadis Babis ([email protected])
Date: 2004-09-30 04:35:32 PST


Thanks marsh

well, This is the technique i wanted to replace and I thought ,
let's give it a try !!

Do you think that should we attend to MS for a feature version ?
Consider this: You have a picture or a map, and you want
dynamicaly to create rectangle areas that you want to
connect with a table (a small geo system)

-- -- -- -- -- -- -- -- -- -- -- -- -- -- --

If you are looking for an alternate approach
And would consider a commercial control,
you might look at our MetaDraw control.

This will allow you to load up an image such as a map
and dynamically create rectangles or other shapes on
top of the image.

Each shape will remain independent and can be assigned
one or more pieces of additional named data – for instance
a name, a reference to some record ID , a URL, the name of
the user working with the image at that time, etc.

You can create the shapes by code or if you wish you can
allow your end user to draw them with his mouse ( but you
can still keep track of such actions in your code if desired ).
You can even allow user to select shapes, drag them around
and resize them. – Of course you have full control over what
user can and can not do.

The overall annotated image may be saved back to the database
or to a file, or you can save the annotations separately.

If this sounds interesting check it out at www.Bennet-Tec.com


* * * * Please include a copy of this message with your reply

Jeff Bennett
(e-mail address removed)

* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================
 
Back
Top