LECTURE 12 :- Button Control (WPF Theory)
• LECTURE 12 :- Button Control (WPF Theory)
Description:-
WPF recognizes three types of button controls:
The familiar Button, the CheckBox, and the RadioButton.
All of these controls are content controls that derive from ButtonBase.
The ButtonBase class includes only a few members.
It defines the Click event and adds support for commands, which allow you to wire buttons to higher-level application tasks .
The ButtonBase class adds a ClickMode property, which determines when a button fires its Click event in response to mouse actions.
The default value is ClickMode.Release, which means the Click event fires when the mouse is clicked and released.
However, you can also choose to fire the Click event when the mouse button is first pressed (ClickMode.Press)
or, oddly enough, whenever the mouse moves over the button and pauses there (ClickMode.Hover).
The Button class represents the ever-present Windows push button.
It adds just two writeable properties, IsCancel and IsDefault:.
When IsCancel is true, this button is designated as the cancel button for a window. If you press the Esc key while positioned anywhere on the current window, this button is triggered.
When IsDefault is true, this button is designated as the default button (also known as the accept button). Its behavior depends on your current location in the window
The CheckBox:-
The CheckBox class doesn’t add any members, so the basic CheckBox interface is defined in the ToggleButton class.
Most important, ToggleButton adds an IsChecked property.
IsChecked is a nullable Boolean, which means it can be set to true, false, or null.
true represents a checked box, while false represents an empty one.
The null value is a little trickier—it represents an indeterminate state, which is displayed as a shaded box.
The RadioButton:-
The RadioButton adds a single property named GroupName, which allows you to control how radio buttons are placed into groups.
Ordinarily, radio buttons are grouped by their container.
That means if you place three RadioButton controls in a single StackPanel, they form a group from which you can select just one of the three.
On the other hand, if you place a combination of radio buttons in two separate StackPanel controls, you have two independent groups on your hands.
The GroupName property allows you to override this behavior.
You can use it to create more than one group in the same container or to create a single group that spans multiple containers.
Either way, the trick is simple—just give all the radio buttons that belong together the same group name.
#WPF #windowsapps #gridpanel #bansodetechsolution #grid #datagrid #autogenerated
PPT Link:-
https://github.com/BansodeTechSolutio...
WPF APPLICATION IN C# #PLAYLIST.
• WPF APPLICATION TUTORIAL IN C#
#Subscribe the Channel Link :- #bansodetechsolution #ajupgrading
https://www.youtube.com/c/AjUpgrading...
If you have any queries or Doubts, DM me on #Instagram:- #bansode_ajay_2102
https://www.instagram.com/bansode_aja...
@AjUpgradingBANSODETECHSOLUTION
LinkedIn Profile
/ aj-upgrading-bansode-tech-solution-0a99657a
Link for slides, code samples, and text version of the video #blogger
https://bansodetechsolution.blogspot.com
WhatsApp Channel Link
https://whatsapp.com/channel/0029VaOl...