Home > Net >  Open, close, and so on digital IO class button how to put controls and write code?
Open, close, and so on digital IO class button how to put controls and write code?

Time:01-10

Small white one, soon learn c #, seen many tutorials, found no interpretation of the open, close, and so on digital IO class button, and it is very important, such as electric valve, the press is open on the panel, press the are off again, so c # form in which controls, write the code to achieve?

CodePudding user response:

Such said in control often use the CheckBox on the UI design, click the CheckBox and the label text next to the CheckBox to change the status of the check, rather than what "button",

CodePudding user response:

Obviously, similar to the CheckBox button, Radio button, and so on are all kinds of the switch of the UI component library selection of the most basic form,

CodePudding user response:

First of all thank you for your reply,
CheckBox is very different from the button on the HMI style, feeling looks weird, now has a solenoid valve, can be controlled on the HMI, press a button is open, press another button is off, is there a better c # corresponding strategy?

CodePudding user response:

Under the existing image flexibly? You can make do with a picture

CodePudding user response:

IO points (DI/DO) input and output, the output you can use the CHECKBOX, such as check the solenoid valves that you will give you a 1 or a true, uncheck to 0 or false, if you want to beautify it, you can change the appearance property into a form button, add foreground or background image and change the layout, can be done very good-looking, input you can use a label or anything of the panel, use a timer or a thread loop scans the input state, based on the input state to change the shape of the picture of the label or color and so on, these are the most basic, the focus is still on your how to read your card or IO card IO,

Here is a project I do IO debug interface, IO is more, so I do is simpler,
  •  Tags:  
  • C#