🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.comp.lang.vba
8 messages
8 total messages Started by michael gois Thu, 07 Aug 2003 12:24
determing which frame a component is placed on
#1
Author: michael gois
Date: Thu, 07 Aug 2003 12:24
18 lines
2373 bytes
Hi
I am building an application which uses several frames, and then frames
inside frames, but not all appearing at the same time.
The problem is that i am now finding sometimes controls which i created and
have no idea where which frame they have been placed on. I can see the
controls in the properties box, but obviously if i dont have the frame on
the screen or if there are frames on top of it, i cannot see the control.
Is there a way to find out what frame a component has been placed on?

Also, on a slightly different note, sometimes I create a control array, but
then decide its best to just have the controls as individual items.  I
rename the control to a name that isnt a control array, but it still remains
an array, and i still have to refer to it as mycontrol(i) as opposed to
mycontrol. Anyone know how to reset a control to be out of a control array?

Thanks

Michael
Re: determing which frame a component is placed on
#2
Author: David Segall
Date: Thu, 07 Aug 2003 13:05
29 lines
2924 bytes
Posted and emailed:
"michael gois" <mikey@gois.net> wrote:

>Hi
>I am building an application which uses several frames, and then frames
>inside frames, but not all appearing at the same time.
>The problem is that i am now finding sometimes controls which i created and
>have no idea where which frame they have been placed on. I can see the
>controls in the properties box, but obviously if i dont have the frame on
>the screen or if there are frames on top of it, i cannot see the control.
>Is there a way to find out what frame a component has been placed on?
>
>Also, on a slightly different note, sometimes I create a control array, but
>then decide its best to just have the controls as individual items.  I
>rename the control to a name that isnt a control array, but it still remains
>an array, and i still have to refer to it as mycontrol(i) as opposed to
>mycontrol. Anyone know how to reset a control to be out of a control array?
>
>Thanks
>
>Michael
>
I have been in a similar situation and wrote a program which prints
the hierarchy of controls on a .frm file by indenting each control
name which is contained in another one. The program, which I named
VBClerk, has some understanding of VB syntax and also contains
separate routines to insert error processing and to resize a form.
Send me an email and I will send you the VB source code of the
program. 
Re: determing which frame a component is placed on
#3
Author: Rick Rothstein
Date: Thu, 07 Aug 2003 13:06
28 lines
3182 bytes
> I am building an application which uses several frames, and then frames
> inside frames, but not all appearing at the same time.
> The problem is that i am now finding sometimes controls which i created
and
> have no idea where which frame they have been placed on. I can see the
> controls in the properties box, but obviously if i dont have the frame on
> the screen or if there are frames on top of it, i cannot see the control.
> Is there a way to find out what frame a component has been placed on?

If I understand you correctly, you can select the Frame that the control is
on (or that you think its on) and either press Ctrl+J or select
Format/Order/BringToFront from VB's menu.


> Also, on a slightly different note, sometimes I create a control array,
but
> then decide its best to just have the controls as individual items.  I
> rename the control to a name that isnt a control array, but it still
remains
> an array, and i still have to refer to it as mycontrol(i) as opposed to
> mycontrol. Anyone know how to reset a control to be out of a control
array?

After renaming the controls, **remove** (that is, delete) the number in the
Index property.


Rick - MVP
Re: determing which frame a component is placed on
#4
Author: David Segall
Date: Thu, 07 Aug 2003 13:14
34 lines
3378 bytes
David Segall <david@segall.net> wrote:

>Posted and emailed:
>"michael gois" <mikey@gois.net> wrote:
>
>>Hi
>>I am building an application which uses several frames, and then frames
>>inside frames, but not all appearing at the same time.
>>The problem is that i am now finding sometimes controls which i created and
>>have no idea where which frame they have been placed on. I can see the
>>controls in the properties box, but obviously if i dont have the frame on
>>the screen or if there are frames on top of it, i cannot see the control.
>>Is there a way to find out what frame a component has been placed on?
>>
>>Also, on a slightly different note, sometimes I create a control array, but
>>then decide its best to just have the controls as individual items.  I
>>rename the control to a name that isnt a control array, but it still remains
>>an array, and i still have to refer to it as mycontrol(i) as opposed to
>>mycontrol. Anyone know how to reset a control to be out of a control array?
>>
>>Thanks
>>
>>Michael
>>
>I have been in a similar situation and wrote a program which prints
>the hierarchy of controls on a .frm file by indenting each control
>name which is contained in another one. The program, which I named
>VBClerk, has some understanding of VB syntax and also contains
>separate routines to insert error processing and to resize a form.
>Send me an email and I will send you the VB source code of the
>program. 
Woops! My reply should have been inserted after your first question.
The answer to your second question is to delete the .index property
after you have renamed the control.
Re: determing which frame a component is placed on
#5
Author: Jeff Johnson [MVP: VB]
Date: Thu, 07 Aug 2003 14:11
23 lines
2309 bytes
"michael gois" <mikey@gois.net> wrote in message
news:FzrYa.53239$9C6.3177735@wards.force9.net...

> I am building an application which uses several frames, and then frames
> inside frames, but not all appearing at the same time.
> The problem is that i am now finding sometimes controls which i created
and
> have no idea where which frame they have been placed on. I can see the
> controls in the properties box, but obviously if i dont have the frame on
> the screen or if there are frames on top of it, i cannot see the control.
> Is there a way to find out what frame a component has been placed on?

You mean while designing in the IDE? No, there is nothing to tell you that.
Even the wonderful MZTools doesn't have such a feature. You could hop into
run mode, break the execution, and type

    ? <YourControl>.Container.Name

in the Immediate window to get the name of the container. If the group box
is in a control array, you'll also want

    ? <YourControl>.Container.Index
Re: determing which frame a component is placed on
#6
Author: Ken Halter
Date: Thu, 07 Aug 2003 14:14
45 lines
3291 bytes
> have no idea where which frame they have been placed on. I can see the
:-) The controls "know" <g>... you can select the name in the property window and check
their Left/Top property to see if they're viewable (compared to the size of the frame)

When you change the name of an element of a control array and decide that it shouldn't be
an array, just click on the Index property and hit backspace (remove the number there).
Once you hit enter, the control will no longer be part of an array. If you've already
added code to the event handlers for that control, you'll need to fix the event
declaration (get rid of the Index param)

At runtime, you can find all controls that are inside any given container control
(frame/picturebox/etc) with the code below. The code allows for nested containers (frame1
inside frame2 etc)

Find Controls in a Container
http://www.vbsight.com/Code.htm


-- 
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep it in the groups..


"michael gois" <mikey@gois.net> wrote in message
news:FzrYa.53239$9C6.3177735@wards.force9.net...
> Hi
> I am building an application which uses several frames, and then frames
> inside frames, but not all appearing at the same time.
> The problem is that i am now finding sometimes controls which i created and
> have no idea where which frame they have been placed on. I can see the
> controls in the properties box, but obviously if i dont have the frame on
> the screen or if there are frames on top of it, i cannot see the control.
> Is there a way to find out what frame a component has been placed on?
>
> Also, on a slightly different note, sometimes I create a control array, but
> then decide its best to just have the controls as individual items.  I
> rename the control to a name that isnt a control array, but it still remains
> an array, and i still have to refer to it as mycontrol(i) as opposed to
> mycontrol. Anyone know how to reset a control to be out of a control array?
>
> Thanks
>
> Michael
>
>
Re: determing which frame a component is placed on
#7
Author: Martin
Date: Fri, 08 Aug 2003 13:07
11 lines
1811 bytes
"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message news:<e7Uq#2OXDHA.1888@TK2MSFTNGP10.phx.gbl>...
 
> You mean while designing in the IDE? No, there is nothing to tell you that.
> Even the wonderful MZTools doesn't have such a feature. 


What you can do with the wonderful MZTools is right click on the form
in the Project window and select Edit File As Text - it is then easy
to see which controls are in which frame, as VB indents them nicely.

Martin
Re: determing which frame a component is placed on
#8
Author: Jeff Johnson [MVP: VB]
Date: Fri, 08 Aug 2003 19:18
15 lines
2087 bytes
"Martin" <cook_ml@hotmail.com> wrote in message
news:ac63e8cd.0308080507.6c3bbdd8@posting.google.com...

> > You mean while designing in the IDE? No, there is nothing to tell you
that.
> > Even the wonderful MZTools doesn't have such a feature.
>
> What you can do with the wonderful MZTools is right click on the form
> in the Project window and select Edit File As Text - it is then easy
> to see which controls are in which frame, as VB indents them nicely.

Well, yes, and you could simply open the .frm file in a text editor
regardless of whether you have MZTools or not. I was referring to the lack
of a more user-friendly process.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads