Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Bài giảng Lập trình C# 2010: Chương 2.3 - ĐH Công nghệ Đồng Nai
Đang chuẩn bị liên kết để tải về tài liệu:
Bài giảng Lập trình C# 2010: Chương 2.3 - ĐH Công nghệ Đồng Nai
Ðức Hải
90
21
pptx
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Bài giảng Lập trình C# 2010: Chương 2.3 trình bày cách thức thực hiện, câu lệnh, nút lệnh và tính năng của các nút lệnh cùng một số nội dung khác về Windows Forms and Windows Forms Controls. | 1 ColorDialog How to use ColorDialog? pnColor btnColor 2 private void btnColor_Click (object sender, EventArgs e) { ColorDialog cldlg= new ColorDialog(); cldlg.Color = pnColor.BackColor; if(cldlg.ShowDialog()==DialogResult.OK) pnColor.BackColor = cldlg.Color; } 3 If you want to set color by the RED, GREEN, BLUE. Please see figure below: pnColor trackBarRed txtRed trackBarBlue txtBlue trackBarGreen txtGreen 4 For each trackbar, please set properties as the same figure 5 private void setColor(){ int nRed = trackBarRed.Value; int nGreen = trackBarGreen.Value; int nBlue = trackBarBlue.Value; txtRed.Text = nRed+""; txtBlue.Text = nBlue + ""; txtGreen.Text = nGreen+""; pnColor.BackColor = Color.FromArgb(nRed, nGreen,nBlue); } 6 Create Event or trackbar control private void processTrackBar (object sender, EventArgs e) { setColor(); } 7 private void frmColorDialog_Load (object sender, EventArgs e) { trackBarBlue.Scroll += processTrackBar; trackBarGreen.Scroll += processTrackBar; trackBarRed.Scroll += processTrackBar; setColor(); } 8 Name Description Maximum The Maximum property sets the value of the track bar when the slider is all the way to the right Minimum Gets or sets the lower limit of the range this TrackBar is working with. Value Gets or sets a numeric value that represents the current position of the scroll box on the track bar 9 Name Description LargeChange Sets how many positions to move if the bar is clicked on either side of the slider SmallChange sets how many positions to move if the keyboard arrows are used to move the slider TickFrequency Establishes how many positions are between each tick-mark 10 FontDialog lblFont How to use FontDialog? btnFont 11 private void btnFont_Click (object sender, EventArgs e) { FontDialog ftDialog = new FontDialog(); ftDialog.Font = lblFont.Font; if (ftDialog.ShowDialog() == DialogResult.OK) { lblFont.Font = ftDialog.Font; } } 12 RichTextBox & StreamFile 13 OpenFileDialog openDlg = new OpenFileDialog(); openDlg.Filter = "(*.txt)|*.txt|(All)|*.*"; if (openDlg.ShowDialog() == DialogResult.OK) { rtFile.LoadFile(openDlg.FileName, RichTextBoxStreamType.PlainText); } 14 You could choose StreamType 15 But We could use StreamFile to read Data. You should Know this 16 Add this command at the top File using System.IO; if (openDlg.ShowDialog() == DialogResult.OK) { //Open to read Stream stream = openDlg.OpenFile(); StreamReader reader = new StreamReader(stream); richTxtFile.Text = reader.ReadToEnd(); reader.Close(); } 17 RichTextBox & StreamFile 18 SaveFileDialog saveDlg = new SaveFileDialog(); saveDlg.Filter = "(*.txt)|*.txt|(All)|*.*"; if (saveDlg.ShowDialog() == DialogResult.OK) { rtFile.SaveFile(saveDlg.FileName,RichTextBoxStreamType.PlainText); } 19 if (saveDlg.ShowDialog() == DialogResult.OK) { Stream stream = saveDlg.OpenFile();//Open to Write StreamWriter writer = new StreamWriter(stream); writer.WriteLine(rtFile.Text); writer.Close(); } Use StreamFile to Write Data. 20 END 21
TÀI LIỆU LIÊN QUAN
Bài giảng Ngôn ngữ lập trình C và C++ (Phần 1: Ngôn ngữ lập trình C) - Chương 1: Ôn tập một số nội dung chính của NNLT C
Bài giảng Ngôn ngữ lập trình C và C++ (Phần 2: Ngôn ngữ C++) - Chương 2: Giới thiệu về ngôn ngữ lập trình C++
Bài giảng Ngôn ngữ lập trình C và C++ (Phần 2: Ngôn ngữ lập trình C++) - Chương 5: Các lớp nhập/xuất trong C++
Bài giảng Ngôn ngữ lập trình C và C++ (Phần 2: Ngôn ngữ lập trình C++) - Chương 3: Lớp và đối tượng
Bài giảng Ngôn ngữ lập trình C và C++: Bài 1 - TS. Đỗ Đăng Khoa
Bài giảng Ngôn ngữ lập trình C và C++ (Phần 2: Ngôn ngữ lập trình C++) - Chương 6: Mẫu (template)
Ngôn Ngữ Lập Trình C#
PHẦN 2: GIỚI THIỆU VỀ MỘT NGÔN NGỮ LẬP TRÌNH NGÔN NGỮ LẬP TRÌNH C
Bài giảng Lập trình cơ bản bài 6: Các khái niệm cơ bản trong ngôn ngữ lập trình C
Bài giảng Ngôn ngữ lập trình C/C++ - GV. Vũ Song Tùng
crossorigin="anonymous">
Đã 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.