Show undelying controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Georges Heinesch

    Show undelying controls

    Hi.

    I have several controls at the same position. The are made visible one
    after the other using the .Visible property.

    While in the design view, I see only the upper control. How can I make
    underlying controls visible (in the design view)?

    TIA

    --
    Georges

  • Georges Heinesch

    #2
    Re: Show undelying controls

    Georges Heinesch wrote:
    [color=blue]
    > I have several controls at the same position. The are made visible one
    > after the other using the .Visible property.
    >
    > While in the design view, I see only the upper control. How can I make
    > underlying controls visible (in the design view)?[/color]

    .... forgot to add ...

    "Send to back" and "Bring to front" (Format menu) doesn't do that for
    some reason.

    --
    Georges

    Comment

    • Scott McDaniel

      #3
      Re: Show undelying controls

      They >are< visible, you just can't see them because your top control covers
      them (obviously). You can select them by using the dropdown (combo) in the
      Formatting toolbar.
      --
      Scott McDaniel
      CS Computer Software


      "Georges Heinesch" <news@geohei.lu > wrote in message
      news:3ff43847$1 _2@news.vo.lu.. .[color=blue]
      > Georges Heinesch wrote:
      >[color=green]
      > > I have several controls at the same position. The are made visible one
      > > after the other using the .Visible property.
      > >
      > > While in the design view, I see only the upper control. How can I make
      > > underlying controls visible (in the design view)?[/color]
      >
      > ... forgot to add ...
      >
      > "Send to back" and "Bring to front" (Format menu) doesn't do that for
      > some reason.
      >
      > --
      > Georges
      >[/color]


      Comment

      • Arno R

        #4
        Re: Show undelying controls

        Georges,
        "Send to back" should work IMO but you need to select the upper control again and again until the
        desired control is on top.

        However I use a different approach when I need controls at the same position:
        I place the controls at the same horizontal location but on different vertical locations (so that
        they are still visible in design view).
        Let's say we need four controls cbo1, cbo2, cb3 and cbo4 (comboboxes in this case)
        You only need a few lines of code on opening your form :
        Me!cbo2.Top=Me! cbo1.Top
        Me!cbo3.Top=Me! cbo1.Top
        Me!cbo3.Top=Me! cbo1.Top

        You don't need "Send to back", or "send to front" anymore ...

        You can use the same approach for the labels (if needed) or you can only use one label
        and change it's caption when you use the visible property.

        --
        Hope this helps
        Arno R



        "Georges Heinesch" <news@geohei.lu > schreef in bericht news:3ff43847$1 _2@news.vo.lu.. .[color=blue]
        > Georges Heinesch wrote:
        >[color=green]
        > > I have several controls at the same position. The are made visible one
        > > after the other using the .Visible property.
        > >
        > > While in the design view, I see only the upper control. How can I make
        > > underlying controls visible (in the design view)?[/color]
        >
        > ... forgot to add ...
        >
        > "Send to back" and "Bring to front" (Format menu) doesn't do that for
        > some reason.
        >
        > --
        > Georges
        >[/color]


        Comment

        • Larry  Linson

          #5
          Re: Show undelying controls

          One way is to write some code that you only execute in design view... one
          procedure to offset each the controls enough that you can select it, and
          another that will set them all back to the same position. You'll have to
          remember to execute it from the Immediate Window... (hmm, I wonder if there
          is indeed a way to automate this...).

          Larry Linson
          Microsoft Access MVP

          "Georges Heinesch" <news@geohei.lu > wrote in message
          news:3ff43847$1 _2@news.vo.lu.. .[color=blue]
          > Georges Heinesch wrote:
          >[color=green]
          > > I have several controls at the same position. The are made visible one
          > > after the other using the .Visible property.
          > >
          > > While in the design view, I see only the upper control. How can I make
          > > underlying controls visible (in the design view)?[/color]
          >
          > ... forgot to add ...
          >
          > "Send to back" and "Bring to front" (Format menu) doesn't do that for
          > some reason.
          >
          > --
          > Georges
          >[/color]


          Comment

          • Georges Heinesch

            #6
            Re: Show undelying controls

            Scott McDaniel wrote:
            [color=blue]
            > They >are< visible, you just can't see them because your top control covers
            > them (obviously). You can select them by using the dropdown (combo) in the
            > Formatting toolbar.[/color]

            I can select them by using the Formatting (Form/Report) dropdown tool in
            this toolbox, but the subform doesn't show up in front of the others.
            The bottom ones stay hidden for some reason?!?!

            --
            Georges

            Comment

            • Georges Heinesch

              #7
              Re: Show undelying controls

              Arno R wrote:
              [color=blue]
              > "Send to back" should work IMO but you need to select the upper control again and again until the
              > desired control is on top.[/color]

              I tried it several times. It doesn't work here (or I am doing something
              wrong).
              [color=blue]
              > However I use a different approach when I need controls at the same position:
              > I place the controls at the same horizontal location but on different vertical locations (so that
              > they are still visible in design view).
              > Let's say we need four controls cbo1, cbo2, cb3 and cbo4 (comboboxes in this case)
              > You only need a few lines of code on opening your form :
              > Me!cbo2.Top=Me! cbo1.Top
              > Me!cbo3.Top=Me! cbo1.Top
              > Me!cbo3.Top=Me! cbo1.Top[/color]

              The .Top method returns "1020". What does this number represent?

              BTW, I don't see a reason why Access doesn't permit the user to change
              the position of controls (or subforms) with "Send to back" or "Bring to
              front". This is even more true considering that those menu items are
              highlighted (can be used) when a control/subform is selected. BTW, with
              controls, the menu items work proberly (bringing the control to the
              front or sending it to the back).

              --
              Georges

              Comment

              • Georges Heinesch

                #8
                Re: Show undelying controls

                Georges Heinesch wrote:
                [color=blue]
                > The .Top method returns "1020". What does this number represent?[/color]

                Ok, I got it now. You change the top positions of the control. That's a
                way indeed!

                But still, I wonder why the "Send to back" or "Bring to front"feature
                doesn't work with subforms.

                --
                Georges

                Comment

                • Arno R

                  #9
                  Re: Show undelying controls

                  Georges,
                  I thought your original question was about controls, not subforms.
                  Subforms are 'special' controls, you can't 'send them to back'.

                  If your question is about subforms then you might consider changing the height at runtime.
                  Make your subforms small (height) and place your subforms in design view in a way that you can
                  easily select them.
                  Then at runtime you can change the .Top and .Height properties as you desire.

                  Just another thought:
                  If you use many subforms (visible one at the time) you can also assign the SourceObject for the
                  subform-control at runtime ...
                  You only need one subform(control ) then.
                  As an aside this might speed up your form a bit because less recordsets need to be loaded.

                  --
                  Hope this helps
                  Arno R


                  "Georges Heinesch" <news@geohei.lu > schreef in bericht news:3ff51a50_2 @news.vo.lu...[color=blue]
                  > Georges Heinesch wrote:
                  >[color=green]
                  > > The .Top method returns "1020". What does this number represent?[/color]
                  >
                  > Ok, I got it now. You change the top positions of the control. That's a
                  > way indeed!
                  >
                  > But still, I wonder why the "Send to back" or "Bring to front"feature
                  > doesn't work with subforms.
                  >
                  > --
                  > Georges
                  >[/color]


                  Comment

                  • Scott McDaniel

                    #10
                    Re: Show undelying controls

                    Yes, they do, and it's kinda annoying. Larry gave you a good idea to fix it
                    .... or you could always "reset" their Top and Left property (i.e. move them)
                    when opening the form, so that in design view you could pretty much put them
                    whereever you wanted. Then, in the FormOpen event just set those props:

                    Sub Form_Open()

                    Me.Ctl2.Left = Me.Ctl1.Left
                    Me.Ctl2.Top = Me.Ctl1.Top

                    Me.Ctl3.Left = Me.Ctl1.Left
                    Me.Ctl3.Top = Me.ctl3.Top

                    etc etc

                    Where Ctl1 is the control you have on "top"

                    --

                    Scott McDaniel
                    CS Computer Software
                    Visual Basic - Access - Sql Server - ASP
                    "Georges Heinesch" <news@geohei.lu > wrote in message
                    news:3ff51508$1 _1@news.vo.lu.. .[color=blue]
                    > Scott McDaniel wrote:
                    >[color=green]
                    > > They >are< visible, you just can't see them because your top control[/color][/color]
                    covers[color=blue][color=green]
                    > > them (obviously). You can select them by using the dropdown (combo) in[/color][/color]
                    the[color=blue][color=green]
                    > > Formatting toolbar.[/color]
                    >
                    > I can select them by using the Formatting (Form/Report) dropdown tool in
                    > this toolbox, but the subform doesn't show up in front of the others.
                    > The bottom ones stay hidden for some reason?!?!
                    >
                    > --
                    > Georges
                    >[/color]


                    Comment

                    • Georges Heinesch

                      #11
                      Re: Show undelying controls

                      Scott McDaniel wrote:
                      [color=blue]
                      > Sub Form_Open()
                      >
                      > Me.Ctl2.Left = Me.Ctl1.Left
                      > Me.Ctl2.Top = Me.Ctl1.Top[/color]

                      In my initial posting, I was talking about controls. In fact I meant
                      subforms, which are behaving differently than regular controls (as I
                      know now only).

                      Your code works fine with controls, but not with subforms.

                      --
                      Georges

                      Comment

                      • Georges Heinesch

                        #12
                        Re: Show undelying controls

                        Arno R wrote:
                        [color=blue]
                        > I thought your original question was about controls, not subforms.
                        > Subforms are 'special' controls, you can't 'send them to back'.[/color]

                        In my initial posting, I was indeed talking about controls. In fact I
                        meant subforms, which are behaving differently than regular controls. At
                        that stage, I thought that a subform is just a normal control, which is
                        not the case as I know now.
                        [color=blue]
                        > If your question is about subforms then you might consider changing the height at runtime.
                        > Make your subforms small (height) and place your subforms in design view in a way that you can
                        > easily select them.
                        > Then at runtime you can change the .Top and .Height properties as you desire.[/color]

                        This was proposed already before. I'm gonna implement that solution most
                        probably.
                        [color=blue]
                        > Just another thought:
                        > If you use many subforms (visible one at the time) you can also assign the SourceObject for the
                        > subform-control at runtime ...
                        > You only need one subform(control ) then.
                        > As an aside this might speed up your form a bit because less recordsets need to be loaded.[/color]

                        Sorry, I lost track here. Could you give details about this solution you
                        propose.

                        Thanks.

                        --
                        Georges

                        Comment

                        Working...