6 Replies Latest reply on Feb 9, 2010 5:55 PM by bparise

    container controls

    bparise

      Does anyone know how, or if, I can use container controls in the IDE.

      A frame is a container control, or at least I thought it was. But when I pace one, and put a text box in it, by clicking text box in the toolbox and then clicking in the frame object already there, not by dragging one from the form in to the frame, and then place a button on the form itself and set the button click event to simply say frame.visible = false: the frame is invisible, but the text box in it is not!!

      I added an active X tabbed dialog control I have used in vb6 to the form, it added fine but still does not behave as a container.

      I need a way of making some controls visibla and some not at run time, I have a complex UI and need to be able to use something like a tabbed dialog or an outlook bar type approach to change the contents of the client area when the user selects different functions.

      It doesn't lend itself to using different menus though, the controls I need to see/hide at any time are all part of the same functional script so I need it to be on the same form, just use a container on top of another container to select which ones I see at any time.

       

      I have looked in to it and discovered something called ISimpleFrameSite, it is mentioned in the docs for one of the activeX tabbed dialog controls I tried.

      I do not know if it is part of or a capability of VBScript or not, or what I can do to make container controls act as containers.

       

      I have used a VB2008 Express program to access the currently opened database in Expedition and that worked, and i used a tabbed dialog that is part of VB2008 Express just fine. But that is an 'out of process' method and accessing the document and the objects wihin it is foreign to me in that type of situation, it is easy in VBScript with the IDE. I like the VB Express approach so if I can figure out how to access the actual document in Expedition and the objects within it, I might go that way in the end.

       

      I would appreciate any help with container controls in VBScript though.

       

      Thanks

      Brendon

        • 1. Re: container controls
          john_dube

          Hi Brendon,

           

          The frame object is just for partitioning the controls within a dialog, it does not "contain" the controls within it.

           

          You can use the Visible property of any control to make it visible or invisible at runtime.

           

          But a better way to do this is to use Layers.  You can add a number of layers, and assign each control to a layer, then make the layers visible or not.

           

          I will post a brief "how-to" on using VB.NET Express, it sounds like that might be a better way to develop your complex application.

           

          John

          • 2. Re: container controls
            bparise

            John,

            Thanks for the info, can you tell me where, if anywhere, in the Automation tutorial or reference it might mention using layers?

            Maybe it's a VBScript thing, but if you never used VBScript before you wouldn't know.

             

            Anyway, useful to know.

            I think I prefer the idea of using VBExpress 2008 though, a lot more capability in programming.I already have a template, many thanks to Satoru. I converted to 2008 and it works fine. Maybe I could send you that and have you take a look.

             

            I would need to know how to do the following things - properly.

             

            • How and where do I put the code for accessing the Expedition Type libraries?
            • If I attach to an instance of Expedition and can access the pcb document, does that mean I have access to

                    all the objects and collections in VB now.?

            • Is it possible to add an exe that I create to the Expedition menu and then run from there?
            • If so, how? And what would need to change if I did that.

             

            A certified template for VB.net, maybe VB6, C++.net and C#.net provided by Mentor would be a huge kick start for people wanting to learn the automation process and would help the users become more productive a lot quicker. I think many more users would opt for using VB Express if there was a well defined starting point for us non-programmers to begin with, safely. If you do post a how to on using vb2008 Express, can you let me know how to access that, where it is ?

             

            As I get more in to it, I will no doubt have more questions, not VB, but about expedition objects and automation.

             

            Thanks, your help is appreciated.

            • 3. Re: container controls
              bparise

              ok, I give up. There just isn't any documentation !!!

              spent most of the day trying to find out HOW to use layers.

              Added a layer, put some controls on it.

              So how, at runtime, so in code, do I set Layer1 to be visible and Layer Default not.

              what is the syntax or methodolgy for turning a layer on and/or off, in code?

               

              please help, I can do everything I need to in VBscript.

               

              I think I will change it to vbnet but this is bugging me and I want to know how to do it in vbscript too.

               

              Thanks

              • 4. Re: container controls
                john_dube

                Hi Brendan,

                 

                Creating and assigning layers is described in the "Automation Editor (IDE) User’s Manual", but it does not describe how to change the layer visibility at runtime.

                 

                The object for editing the form properties is called "TheView", and it has a property called Layer that is an associative array indexed by the layer name, and those values are set to 1 (visible) or 0 (invisible).

                 

                So, to make Layer1 visible, call:

                 

                     TheView.Layer("Layer1") = 1

                 

                To make Layer2 invisible, call:

                 

                     TheView.Layer("Layer2") = 0

                 

                I have attached a simple, meaningless, example form to illustrate.

                 

                John

                • 5. Re: container controls
                  john_dube

                  Hi Brendan,

                   

                  Creating and assigning layers is described in the "Automation Editor (IDE) User’s Manual", but it does not describe how to change the layer visibility at runtime.

                   

                  The object for editing the form properties is called "TheView", and it has a property called Layer that is an associative array indexed by the layer name, and those values are set to 1 (visible) or 0 (invisible).

                   

                  So, to make Layer1 visible, call:

                   

                       TheView.Layer("Layer1") = 1

                   

                  To make Layer2 invisible, call:

                   

                       TheView.Layer("Layer2") = 0

                   

                  John

                  • 6. Re: container controls
                    bparise

                    John,

                    Thanks very much, so easy when you see it. I had tried something very similar but used true and false instead of 0 and 1, and didn't have the quotes around the layer name.

                     

                    Maybe the scripting guide could mention this kind of thing in a future release, if the property is there then it would be good to know how to use it, in detail. This comment applies to all the properties of all the IDE objects, it would sure make things a lot easier if us newbies could get the info we needed, without having to bug you with such silly questions.

                     

                    thanks a lot anyway, I really look forward to your post on the vb net 2008 usage.

                     

                    Brendon