• Disabling?? hyperlinks… (2000 SR-3)

    • This topic has 8 replies, 3 voices, and was last updated 21 years ago.
    Author
    Topic
    #402645

    I’m just curious about something… When certain criteria is met, I do things like set Enabled to False for controls like Command Buttons, Text Boxes, Subforms, etc… In this case I want to “disable” two different types of controls …namely Labels and Images… that have a value in the Hyperlink Address property… Since there’s no Enabled property for those two control types, I can’t do that… Does anyone know the best way to do this? … Thanks in advance… smile

    Viewing 3 reply threads
    Author
    Replies
    • #802812

      Trudi,

      When faced with similar problems, I’ve opted to use the “Visible” property to force the label or image to become invisible until needed.

      Alternatively, for the label control at least, you could define the label area as a command button, and set the other properties of the button such that it looks like a label. The command button can be set inactive by simply clearing all related events. Actually, you might be able to use the command button to also replace the image control, as well (though I’ve never tried it).

      — Jim

      • #802814

        Thanks Jim! I thought about that… It might end up that I have to do that… I’m helping someone else with their database and I was hoping to not have to get them to change form design at this stage… but… whatever works right? lol…

      • #802815

        Thanks Jim! I thought about that… It might end up that I have to do that… I’m helping someone else with their database and I was hoping to not have to get them to change form design at this stage… but… whatever works right? lol…

    • #802813

      Trudi,

      When faced with similar problems, I’ve opted to use the “Visible” property to force the label or image to become invisible until needed.

      Alternatively, for the label control at least, you could define the label area as a command button, and set the other properties of the button such that it looks like a label. The command button can be set inactive by simply clearing all related events. Actually, you might be able to use the command button to also replace the image control, as well (though I’ve never tried it).

      — Jim

    • #802830

      Trudi,

      Another option may be to set the hyperlink property to a null string when disabled and to the intended address when enabled. This has the disadvantage (for labels and images) that it’s not obvious, appearance-wise, when they’re enabled vs. disabled.

      A more cumbersome approach would be to have two overlapping controls – one that looks the way you want it to look when things are enabled (including the hyperlink address) and another one (on top of it) to look the way you want it to look when disabled — maybe a different image or a differently colored label. Then set visible to true for the former and to false for the latter when you want it enabled and vise versa when you want it disabled.

      These both, of course, require some “design changes” which you are apparently trying to avoid.

      • #802853

        Thanks Tom!

        I did think of setting the hyperlink property to a null string but there are quite a few of these images and labels to deal with… I also had the idea of removing the value from the hyperlink address property itself… and adding some code in the click event to deal with it… I could do a boolean test in that procedure… I like your second idea… Creating Image and labels over top of one another… and making the right ones visible at the right time… I could name all of the “disabled” ones with the same prefix and see the visible property to true on demand…

        Hmm… Gotta think this one through… I just wanted to check with others to see if I was missing some obvious and simple way of accomplishing this…

        Thanks again! Have a great day! smile

      • #802854

        Thanks Tom!

        I did think of setting the hyperlink property to a null string but there are quite a few of these images and labels to deal with… I also had the idea of removing the value from the hyperlink address property itself… and adding some code in the click event to deal with it… I could do a boolean test in that procedure… I like your second idea… Creating Image and labels over top of one another… and making the right ones visible at the right time… I could name all of the “disabled” ones with the same prefix and see the visible property to true on demand…

        Hmm… Gotta think this one through… I just wanted to check with others to see if I was missing some obvious and simple way of accomplishing this…

        Thanks again! Have a great day! smile

    • #802831

      Trudi,

      Another option may be to set the hyperlink property to a null string when disabled and to the intended address when enabled. This has the disadvantage (for labels and images) that it’s not obvious, appearance-wise, when they’re enabled vs. disabled.

      A more cumbersome approach would be to have two overlapping controls – one that looks the way you want it to look when things are enabled (including the hyperlink address) and another one (on top of it) to look the way you want it to look when disabled — maybe a different image or a differently colored label. Then set visible to true for the former and to false for the latter when you want it enabled and vise versa when you want it disabled.

      These both, of course, require some “design changes” which you are apparently trying to avoid.

    Viewing 3 reply threads
    Reply To: Disabling?? hyperlinks… (2000 SR-3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: