简体   繁体   中英

C# Web Application - Depressed Button Appearance

I'm trying to implement something like the following graphic below; where the user has 3 possible options, and the current option looks like a depressed button.

按钮样机

Everything I've found so far wants me to use a CheckBox with the appearance property set; but that is for windows forms, and not a web application.

Is this possible to do?

Plain old html with CSS.... one with border-style: 1px outset black; for unselected state and another one border-style: 1px inset black; for selected state. That way you avoid the use of custom images that are usually heavier. To control state, add a query string parameter that specifies which button is selected.

Then is just matter of setting the appropiate CSS class. No images, no extra load, just HTML.

With a web application you can replace the buttons image with another image (that of a depressed button), or enable / disable the button to give the effect that it has been pressed. We need more info or sample code of what you have tried or what you want to try. For instance, are you dealing with image buttons?

I would use custom images for this (and not HTML buttons).

Have two images for each button: pressed and unpressed. And keep track of the state so you can show the appropriate one. Or better yet, wrap the buttons in a simple web control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM