Đang chuẩn bị liên kết để tải về tài liệu:
Apress-Visual CSharp 2010 Recipes A Problem Solution Approach_10

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

GetTemplateChild to find the button defined by its actual template. If this exists, it adds an event handler to the button’s Click event. The code for the control is as follows: using using using using System.Windows; System.Windows.Controls; System.Windows.Markup; Microsoft.Win32; | CHAPTER 17 WINDOWS PRESENTATION FOUNDATION GetTemplateChild to find the button defined by its actual template. If this exists it adds an event handler to the button s Click event. The code for the control is as follows using System.Windows using System.Windows.Controls using System.Windows.Markup using Microsoft.Win32 namespace Apress.VisualCSharpRecipes.Chapter17 TemplatePart Name PART_Browse Type typeof Button ContentProperty FileName public class FileInputControl Control static FileInputControl r DefaultStyleKeyProperty.OverrideMetadata typeof FileInputControl new FrameworkPropertyMetadata typeof FileInputControl public override void OnApplyTemplate base.OnApplyTemplate Button browseButton base.GetTemplateChild PART_Browse as Button if browseButton null browseButton.Click new RoutedEventHandler browseButton_Click void browseButton_Click object sender RoutedEventArgs e OpenFileDialog dlg new OpenFileDialog if dlg.ShowDialog true this.FileName dlg.FileName public string FileName get . return string GetValue FileNameProperty 830 CHAPTER 17 WINDOWS PRESENTATION FOUNDATION set SetValue FileNameProperty value public static readonly Dependencyproperty FileNameProperty DependencyProperty.Register FileName typeof string typeof FileInputControl The default style and control template for FileInputControl is in a ResourceDictionary in the Themes subfolder and is merged into the Generic ResourceDictionary. The XAML for this style is as follows ResourceDictionary xmlns http schemas.microsoft.com winfx 2006 xaml presentation xmlns x http schemas.microsoft.com winfx 2006 xaml xmlns local clr-namespace Apress.VisualCSharpRecipes.Chapter17 assembly Style TargetType x Type local FileInputControl Setter Property Template Setter.Value ControlTemplate TargetType x Type local FileInputControl Border Background TemplateBinding Background BorderBrush TemplateBinding BorderBrush BorderThickness TemplateBinding BorderThickness DockPanel Button x Name PART_Browse DockPanel.Dock Right .

TÀI LIỆU LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.