Alpha Video Training
Results 1 to 11 of 11

Thread: Tabbed Subform and Buttons

  1. #1
    Member
    Real Name
    Beau Woods
    Join Date
    Feb 2007
    Location
    Central Coast, NSW, Australia
    Posts
    96

    Default Tabbed Subform and Buttons

    I have a form with a tabbed subform for my customer data. On the from next to the subform i have a series of buttons. Is there any was to Enable/Disable these buttons depending on which tab on the subform has focus?

    Beau

  2. #2
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Tabbed Subform and Buttons

    Try looking at conditional objects or I believe you can control object properties using xbasic. I'd like to give you the full solution but I am new to A5 and although I have read the help files on these subjects I have yet to use them.

  3. #3
    Member
    Real Name
    Beau Woods
    Join Date
    Feb 2007
    Location
    Central Coast, NSW, Australia
    Posts
    96

    Default Re: Tabbed Subform and Buttons

    I am pretty sure that the conditional objects hide certain objects on the from due to a condition. I only want to disable the button not hide it. I am only a newbie myself and dont know much about xbasic. Thanks for the thought.

    beau

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,300

    Default Re: Tabbed Subform and Buttons

    Beau, I think you could use the OnTabChange event for the tabbed object to enable or disable the button controls. You'd do this by running either the .enable() or .disable() method for each button object. The OnTabChange script would figure out which tab had focus and then run the appropriate button control method for each button. Check the help file explanation for both events and methods applicable to Tabbed Control (form); and then the discussioin of methods for the Button Control (form).
    Last edited by Tom Cone Jr; 02-08-2007 at 08:08 AM. Reason: correcting mistakes

  5. #5
    Member
    Real Name
    Geoff Meredith
    Join Date
    Aug 2006
    Posts
    637

    Default Re: Tabbed Subform and Buttons

    In the help file under button properties it gives the following xbasic reference.

    Hide - :formname.controlname.object.visible as L
    (When checked the button becomes invisible.)

    There is also an action script function under object properties(set/get) to hide and show objects.

  6. #6
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Tabbed Subform and Buttons

    Beau,

    I would use the following for using the OnTabChange event. Sheets simply refer to the tabs and how many depend on how many tabs of course. The button number suffix can be seen in the object's properties. Modify to whatever you have and want.


    Code:
    sheet = topparent:TABBED1.tab_get()
    t=table.current()
        if sheet=1 then 
            button1.disable()
            button2.disable()
            button3.enable()	
          elseif sheet=2 then 
            button1.disable()
            button2.enable()
            button3.disable()
          elseif sheet=3 then   
            button1.enable()
            button2.disable()
            button3.disable()
        end if
    topparent.resynch()
    Mike

  7. #7
    Member
    Real Name
    Beau Woods
    Join Date
    Feb 2007
    Location
    Central Coast, NSW, Australia
    Posts
    96

    Default Re: Tabbed Subform and Buttons

    Hi Mike,
    Your solution works well, thanks for the info. Is there anyway to grey the button out at the same time so people know it can't be used?

    Thanks,
    Beau

  8. #8
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Tabbed Subform and Buttons

    Beau,

    Within the code you use you can set whatever properties you want---check out the "Object Explorer" to find all the properites and such of each object. I wish someone told me about this when I first started! I spent a month trying to figure out how everyone but me knew what everything was called!
    Experiment in the button properties to see what combination suits you for graying out something--once you find the color and transparency you want simply set them with the script.

    Mike

    Edit: This current thread shows a few of the properties you can set. Just thought to throw this your way.


    http://msgboard.alphasoftware.com/al...ad.php?t=58535
    Last edited by MikeC; 02-08-2007 at 09:09 PM. Reason: more info

  9. #9
    Member
    Real Name
    Beau Woods
    Join Date
    Feb 2007
    Location
    Central Coast, NSW, Australia
    Posts
    96

    Default Re: Tabbed Subform and Buttons

    Thanks for the help Mike, had a look and found what i needed to change the font color with the xbasic. My only problem is with the script is that when i first open the form it does not know that it is on sheet1 and does not disable the buttons until i goto another tab and back again.

    Beau

  10. #10
    Member
    Real Name
    Beau Woods
    Join Date
    Feb 2007
    Location
    Central Coast, NSW, Australia
    Posts
    96

    Default Re: Tabbed Subform and Buttons

    Ok then i fixed this by adding this code to the OnActivate event for the form.
    sheet = topparent:CustomerTabbed.tab_get()
    t=table.current()
    button2.disable()
    button2.font.color="Gray-40"
    button6.disable()
    button6.font.color="Gray-40"
    topparent.resynch()
    Thanks for the help.

    Beau

  11. #11
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Tabbed Subform and Buttons

    Beau,

    I couldn't get on the messageboard this am as must have been down but exactly as what I would have suggested! Good job! :) Just remember, almost any question you may have most likely has been answered somewhere on this messageboard...just a matter of figuring out how to do searches is all (which sometimes is harder than the actual programming! ).


    MIke

Similar Threads

  1. checkbox in tabbed subform
    By Alan Henson in forum Alpha Five Version 6
    Replies: 4
    Last Post: 10-25-2004, 12:07 AM
  2. Tabbed Subform
    By Tom Henkel in forum Alpha Five Version 5
    Replies: 3
    Last Post: 09-14-2004, 06:37 AM
  3. Tabbed Subform
    By Mortie in forum Alpha Five Version 5
    Replies: 5
    Last Post: 03-30-2003, 07:49 AM
  4. Subform for Navigation Buttons ?
    By Steven Spencer in forum Alpha Five Version 5
    Replies: 4
    Last Post: 12-17-2002, 10:14 AM
  5. subform buttons
    By ROBERT SULLIVAN in forum Alpha Five Version 4
    Replies: 2
    Last Post: 06-25-2001, 11:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •