Hide/unhide button

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

I have a default image, called "MyImage", on all my forms. Can i hide/unhide
this image by changing one parameter in a module (e.g.
me.myimage.visable=false)?

Tried various things but can't get it to work....

Thanx for any tips!


Regards,

Harmannus
 
Depends upon where the code that does this is located. Your code example
would work only in the form's module, not in a regular module. (I'm assuming
that your misspelling of Visible is a typo and not actually in your code).

Please provide more information about what and when and where.....
 
Hallo,

Thanx for the reply!

In other words ;-)

On all my form i have a image "MyImage". Can i hide (not visible) or unhide
(visible) this image for "all" my forms by changing 1 parameter through code
in a module?

Hope this is clear...

Regards,

Harmannus
 
You can use a global variable (boolean) that is declared in a regular
module, and then you can set the value of the variable in any other module;
those other modules also can read that variable's value and use it to decide
whether to show the image or not.

However, global variables can be "reset" if an unhandled error occurs in
your code, so you need to be careful with them.

It may be better to use something like a function that returns a True or
False based on some condition....for example, is there some condition that
you use to know whether the image should be visible or not? Assuming that
there is, you can use a Public Function:

Public Function MakeImageVisible() As Boolean
MakeImageVisible = ConditionIsTrue
End Function

Where ConditionIsTrue should be replaced by an expression that gives you a
True or False value based on some condition. You then would call this
function in each of the form's OnLoad event (for example):
Me.ImageName.Visible = MakeImageVisible()

If you can provide more info about how you decide whether to make the image
visible or not, we can probably susggest more specfic info.
 
Hallo,

Thanx for the information!

I have hidden full access en limited access buttons on my switchboard with
the below code in a module

Sub SetFullStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning! Change to
name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowToolbarChanges", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowShortcutMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
End Sub

Sub SetLimitedStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning! Change to
name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowToolbarChanges", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
End Sub

I would like to add myimage.visible = true to the full access code and the
myimage.visible=false code to the limited access code.....

Can this be done (with your code)?

Regards,

Harmannus
 
Harmannus said:
Hallo,

Thanx for the information!

I have hidden full access en limited access buttons on my switchboard
with the below code in a module

Sub SetFullStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning! Change
to name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowToolbarChanges", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowShortcutMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
End Sub

Sub SetLimitedStartupProperties()
ChangeProperty "StartupForm", dbText, "Switchboard" 'Warning!
Change to name of startupform
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowToolbarChanges", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowShortcutMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
End Sub

I would like to add myimage.visible = true to the full access code
and the myimage.visible=false code to the limited access code.....

Can this be done (with your code)?

Regards,

Harmannus

I've been answering this question where you posted it question
independently in a different newsgroup. That's called "multiposting",
and it's generally frowned on because others don't know what answers
have already been given, and so they duplicate the effort. Also it's
harder for you to keep track of the various replies, and it's harder for
later readers of the question, who may be looking for the same answer,
to learn what they need.

In most cases a single, well-chosen newsgroup will do. If your question
really is relevant to more than one newsgroup, the approved technique is
to "crosspost" it instead, by listing multiple newsgroups in the To: or
Newsgroups: line of a single message. If you do that, the message and
any replies will appear in all the listed newsgroups automatically,
which is beneficial to all concerned.
 
Back
Top