Click to See Complete Forum and Search --> : How to get a label onto a frame at run-time
tobeyu
August 2nd, 2001, 01:12 PM
I need to be able to place label controls on an existing frame control at run-time. I want to be able to dynamically draw a label (which is the easy part) but need it to show on the form. I know all about ZOrder and the 3 layers. I know a label will show on a frame if it was added at design-time but how can I make that happen at run-time?
Thanks for any help,
Tobey
tobeyu
August 2nd, 2001, 01:15 PM
One more thing. I have been trying to get this for a while now but o no luck. Is there any kind of call that could made to the API to get this to work? I know how to do this with a window and the SetWindowPos function, but I am not sure how to do that with a control.
Thanks again..
deghost
August 2nd, 2001, 03:03 PM
if you don't have to use an Image control but may use the Picture control you may try this:
on the form, draw the frame first and the Picture second, that way if you put the picture in the same place the frame is it will be above the frame. image works a bit differently but you can try manipulating with this.
----------
The @host is everywhere!
----------
tobeyu
August 2nd, 2001, 04:09 PM
Well, I am not sure I understand your idea. I am not using an image control or a picture control. Basically, what I am doing, is making a Visual Basic-type IDE for a proprietary language. I need to be able to dynamically create controls. I can draw any of them, including the frame and label however when I draw a label on the frame it is behind the frame. All of the others are just fine but I need the label to be visible on the form. Clear as mud?
Clearcode
August 3rd, 2001, 02:23 AM
In code....
set lblTemp(lIndex).Container = fraTemp(lIndex)
Makes the label a child of the frame. Note that you cannot use API calls to achieve this because a label is a lightweight control i.e. it doesn't have a true window of its own.
Hope this helps,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
tobeyu
August 3rd, 2001, 08:13 AM
oh my goodness! I forgot all about that. worked like a charm. thanks ever so much..
Tobey
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.