Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Dynamic tabs for desktop form possible?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Dynamic tabs for desktop form possible?

    Can tabs be created dynamically on a destop form? Or more specifically can the code of Learning XDialog Chapter 8 on creating tabs be used with a desktop form using XBasic?

    I would like to add tabs dynamically to a form.

    Here's an example:
    Person A has Addresses, Books and CDs
    Person B has Addresses, DVDs, and VCR tapes

    When I open the person form, I would like to display tabs for each of the above categories. In my example above, Person A and B would each have three tabs by the title of the tabs would be different.

    What I do NOT want to do is create tabs as follows for all persons:
    Addresses, Books, CDs, DVDs, VCR tapes

    In the past, I did something like this fairly easily using a Microsoft Access Tab Strip control.

    Here is some sample code on how to do this using Microsoft Access.

    Code:
    Dim txt1 As New System.Windows.Forms.TextBox
             Dim lbl1 As New System.Windows.Forms.Label
             lbl1.Text = "abc"
             Dim cbo1 As New System.Windows.Forms.ComboBox
             With cbo1
                 cbo1.Items.Add("1")
                 cbo1.Items.Add("2")
                 cbo1.Items.Add("3")
                 cbo1.SelectedIndex = 0
             End With
             With TabControl1
                 .TabPages.Item(0).Text = "General Info"
                 .TabPages.Item(0).Name = .TabPages.Item(0).Text
                 .TabPages.Item(1).Text = "Details"
                 .TabPages.Item(1).Name = .TabPages.Item(1).Text
                 .TabPages.Add("Implementation")
                 .TabPages.Item(2).Name = .TabPages.Item(2).Text
                 .TabPages.Item(0).Controls.Add(txt1)
                 .TabPages.Item("Details").Controls.Add(lbl1)
                 .TabPages.Item(2).Controls.Add(cbo1)
             End With
    In this example, the tab control is placed on the form, and then the properties of the tabs including text and perhaps subform can be specified with Visual Basic code.

    I am not interested in using XDialog to create a complete form, but wonder if the code in the XDialog examples can somehow be applied to Alpha's Tab control in the form's toolboxes?

    Or to accomplish this do you have to abandon Alpha's tab control altogether?

    Bob McGaffic
    Pittsburgh, PA
    Last edited by rmcgaffic; 04-21-2009, 10:36 PM.

    #2
    Re: Dynamic tabs for desktop form possible?

    Hi Bob,

    I know this this is not the answer to your question but a suggested solution.

    How about conditional objects?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: Dynamic tabs for desktop form possible?

      Bob,

      You can change the text of the tabbed object dynamically as follows.
      Code:
      TABBED1.tabs.sheet[1].text="my tab page title"
      Where TABBED1 is the object name and sheet[1] is the tab page.

      Is this what you wanted?

      Geoff

      Comment


        #4
        Re: Dynamic tabs for desktop form possible?

        Geoff,

        Thank you. I tried your code and it works perfectly.

        But I'm also looking for a way to dynamically add tabs to the control.

        Im looking at the methods in the documentation and I can't find an "Add tab" method. Or does it have a different name?

        For example, if the tabbed control has three tabs on the form and I want to add three more tabs dynamically, the following code errors for the 4th tab because it does not exist on the control on the form.

        Code:
        TABBED1.tabs.sheet[1].text="My tab 1"
        TABBED1.tabs.sheet[2].text="My tab 2"
        TABBED1.tabs.sheet[3].text="My tab 3"
        TABBED1.tabs.sheet[4].text="My tab 4"
        TABBED1.tabs.sheet[5].text="My tab 5"
        TABBED1.tabs.sheet[6].text="My tab 6"
        Because I couldn't find a way to add a tab, maybe I should add a large number of tabs say 25 and hide the ones that are not needed. Unfortunately thie code below errors out.

        Code:
        TABBED1.tabs.sheet[2].hide()
        So my question remains can you add a tab with code to the Alpha Five tabbed control on a desktop form?

        Bob McGaffic
        Pittsburgh

        Comment


          #5
          Re: Dynamic tabs for desktop form possible?

          Just read your thread again and see you also want to use different subforms. It is possible (at least in V8) to put one subform on top of another. Then using code on the relevant event you can make one visible and the other hide.

          Code:
          parentform:Form1.object.visible = .T.
          parentform:Form2.object.visible = .F.
          Maybe an option?

          Comment


            #6
            Re: Dynamic tabs for desktop form possible?

            Bob,

            I tried all the stuff you did as well, .add, .new, .hide, but nothing would do it. The enire tab control can be hidden but that's a lot of work to create a full set of tab controls for each case. You can set a tab text to "" and that makes the tab really small but I'm not sure if you can prevent clicking into it.

            Do you know about the Object Explorer? View - Object Explorer, while you're in form design. You can see the properties of the tab object but there's nothing in there that would help.

            Just did this really fast, 'cause I gotta go, but I just dropped the MS Tab Strip control into an A5 form I it displayed. You'll need to use the OLE Automation Browser to see if you can get it to work. I also dropped a text field onto one of the tabs but it doesn't display, so maybe no go... but have a look.
            Last edited by Davidk; 04-22-2009, 09:28 AM.

            Comment


              #7
              Re: Dynamic tabs for desktop form possible?

              As far as I am aware you cannot hide the tabs or create/delete tabs dynamically. It doesn't look great but if you set the page title to "" then it minimises it as long as you haven't set the tabs to a fixed width. I haven't done it but it should be possible to make your own tab object using buttons which will give you more control over showing and hiding them.

              Comment


                #8
                Re: Dynamic tabs for desktop form possible?

                I think Keith's idea of the conditional object is the way to go using buttons to change layers. In fact I think you could end up with something more aesthetically pleasing as you can use own bitmap style for the buttons (tabs) and by placing the conditional object over a frame or bitmap you can produce a unique style. It will take more time and effort but that is for you to judge if it is worth it.

                Comment


                  #9
                  Re: Dynamic tabs for desktop form possible?

                  Geoff and David,

                  Thanks for your followup comments.

                  I'm going to have to go back to my old files and find some work I did in 2000 -- to find the Microsoft control that made this so easy.

                  I'm somewhat disappointed that Alpha's controls don't offer the functionality that these old Access controls did.

                  Using Access it was so easy 10 years ago to:
                  1. Place a splitter bar on a form
                  2. Fill a tree control with recursive information
                  3. Dynamically add and delete tabs

                  All three of these tasks have proven less than straightforward with Alpha.

                  I'm going to post a separate thread to see if Richard & Selwyn will share with us the tab control they use for the open forms at the bottom of the screen.

                  Bob McGaffic
                  Pittsburgh, PA

                  Comment


                    #10
                    Re: Dynamic tabs for desktop form possible?

                    I agree it would make life easier. I think many of these controls have been neglected over the years as Alpha has concentrated more and more on the web side of things. I assume they have limited resources and had to make a commercial decision on where to apply them. Unfortunately it seems the desktop application has been the loser. The tree control is very poor and outdated which has left it virtually unusable for me and you have highlighted on a number of occasions the deficiencies/inconsistencies of many of the other controls. However I still accomplish more with A5 than other software so its not all bad and heres hoping V10 might be the answer to some of our problems:).

                    Comment

                    Working...
                    X