Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the WPF control

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to use WPF controls". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1.GroupBox

Note: GroupBox still needs a layout container to place elements. Such as: StackPanel panel

One two three 2.TabControl

Tabbed controls like this are very common in winform, Tabpge subpages, and in WPF, corresponding to the TabItem class.

The code diagram shown is:

Button1 button2 button3 button4 button5 button6

Like the Content property, the Header of TabItem can also receive any type of object. This means that you can create a combo box or tab. Include arbitrary graphics and elements in their page titles. As follows:

♥ Home button1 button2 button3 3.Expander menu Control

Content shrinking controls with titles, common in web, are used for left-hand menus.

The code is as follows:

Ofo has been favored by the public, even the foreign people speak highly of it. These yellow bikes can be found everywhere, so the people who are ina hurry can use it and then reached the destination in time. Especially for the visitors, they can ride these bikes and then have a look at the scenery around. It can saves them a lot of money and the most important thing is the convenience it brings. 4.ListBox control

The ListBox control is a very flexible control that contains not only child element ListBoxItem objects. You can also host other elements, that is, the ListBoxItem class inherits from the ContentControl class, so that the ListBoxItem can contain a piece of nested content.

For example, create a list that contains normal buttons. As follows:

♥ button1 ♥ button2 ♥ button3 5. ProgressBar progress bar

The IsIndeterminate property is set to True, and the control periodically displays a green (default) pulse from left to right.

Of course, we can also change the color of the scroll by modifying the Foreground property. As shown below

6. Date control

There are two date controls in WPF, Calendar and DatePicker, the former in the form of a calendar and the latter like a text box.

At the same time, the control also has many properties.

DisplayDateStart

And

DisplayDateEnd

Sets the date template displayed in the calendar view, from the first early date (DisplayDateStart) to the last most recent

(DisplayDateEnd), users cannot navigate to a month that does not contain a date that can be displayed. In order to show the

If there is a date, you can set the DisplayDateStart property to DateTime.MinValue and set the DisplayDateEnd

W property is set to DateTime.MaxValue

BlackoutDates

Save a collection of dates that will be disabled or cannot be selected in the calendar? If the date is not in the daily norm ra that can be displayed.

, or mustard, if one of these dates has been selected, an exception will be received in order to prevent the selection of any

What is the past date, you can call the BlackoutDates.AddDatcsInPast () method

SelectedDate

Provide the selected date (or name?) as a DateTime object. Use the null value when no date is selected). Can be passed through

Code, by clicking a date in the calendar, or by typing a date character by the user (in the DatePicker control >

Set this property. In the calendar view, the selected date is identified by a box with a shadow, and only when the date is controlled

The box is displayed only when the item has focus.

SelectedDates provides the selected date as a collection of DateTime objects. This property is supported by the Calcndar control and is useful only if the SelectionMode property is modified to allow multiple dates to be selected (use the Datetime object to determine the date initially displayed in the calendar view. If the property is empty, the value of the selectedDate property is displayed. If both the DisPlayDate and select day LDate properties are empty, the current date is used. The date displayed determines the original month page in the calendar view. When the date control has focus, a square border is displayed around the appropriate day of the month (the border is different from the shadow box used to select the date currently) FristDayOfweek determines the start position of each row in the calendar (leftmost) displays which day of the week IsToDayHighighted determines whether the calendar view highlights the current date "how to use the WPF control" and that's it. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report