Align Visible Buttons on Menu Form (1 Viewer)

tucker61

Registered User.
Local time
Yesterday, 19:12
Joined
Jan 13, 2008
Messages
321
Hi all, My Main Menu only shows buttons which are relevant dependent on the user permissions, this often leads with when people see the form there are blanks where the buttons are hidden.

Is there a way to arrange the buttons, so the only ones that are visible are all aligned at the top of the page, and the non visible ones are somewhere else - or - should i show all the buttons and provide a Msgbox for when users do not have permissions to go into the form ?

What do you guys recommend.
 

Dreamweaver

Well-known member
Local time
Today, 03:12
Joined
Nov 28, 2005
Messages
2,466
You could disable them instead of hiding them, the other way would be a bit harder you could rearange the buttons with code.
 

Isaac

Lifelong Learner
Local time
Yesterday, 19:12
Joined
Mar 14, 2017
Messages
8,774
I love what you are doing, because I believe appropriate visual cues is what a good GUI is all about !!

I recommend just disabling them. This provides a subtle yet sophisticated clue that "This feature exists, but now is the wrong context to use it" (or "you cannot use it" etc). Of course there is a time for totally hiding things that are wildly out of context or if you don't even want someone to know that someone else has permissions to do a certain something.

But I think 8 times out of 10, it's better to disable them. For example, in your case, seeing a disabled button may lead someone to:
1) realize the function exists
2) understand that they lack permissions to perform it
3) go ask the appropriate person to perform it, if/when needed

...All that useful 'leading' just from a disabled button.
 

Dreamweaver

Well-known member
Local time
Today, 03:12
Joined
Nov 28, 2005
Messages
2,466
I moved a button in my last program because it didn't look right so I moved it when conditions were met the display did look much better for it.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:12
Joined
Feb 19, 2002
Messages
43,213
For this reason, I don't use buttons as a menu. I use subforms with lists of what is available. You can make the subform continuous and hide the borders to make it look flat but you just get one column.

Otherwise, if you are determined to use buttons, then I would use Isaac's technique.

Here's an example that uses a custom menu and some simple security that might give you some ideas.
 

Attachments

  • SwitchboardForm20201104.zip
    1.6 MB · Views: 86

CJ_London

Super Moderator
Staff member
Local time
Today, 03:12
Joined
Feb 19, 2013
Messages
16,603
I go with Pat's method - however
Is there a way to arrange the buttons, so the only ones that are visible are all aligned at the top of the page

you can use a loop in the form open event to align your visible buttons - the hidden ones don't matter since you can't see them anyway

something like

Code:
dim ctl as control
dim posX as integer

posX=60 'set first position just off the edge of the form
for each ctl in me.section(1).controls 'section(1) is the form header
    if ctl.controltype=accommandbutton and ctl.visible then
        ctl.left=posX
        posX=posX+ctl.width+60 ' leave a gap for the next one
   end if
next ctl
 

tucker61

Registered User.
Local time
Yesterday, 19:12
Joined
Jan 13, 2008
Messages
321
Thanks for the advise, initially i have gone with Issac's suggestion which seems to be working. I will look at Pat's suggestion for in the future.
 

Users who are viewing this thread

Top Bottom