Không có gì tuyệt vời hơn là luyện tập với ví dụ thực tế. Nào cùng nhau thử thách bản thân với một ứng dụng thú vị: Từ điển nói.
Code file Form1.designer.cs
namespace SpeakDictionary
{
partial class Form1
{
private System.ComponentModel.IContainer components = null ;
protected override void Dispose (bool disposing)
{
if (disposing && (components != null ))
{
components.Dispose();
}
base .Dispose(disposing);
}
#region Windows Form Designer generated code
private void InitializeComponent ()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof (Form1));
this .panel1 = new System.Windows.Forms.Panel();
this .panel2 = new System.Windows.Forms.Panel();
this .txbMeaning = new System.Windows.Forms.TextBox();
this .txbExplaination = new System.Windows.Forms.TextBox();
this .cbWord = new System.Windows.Forms.ComboBox();
this .btnSpeakEnglish = new System.Windows.Forms.Button();
this .button1 = new System.Windows.Forms.Button();
this .button2 = new System.Windows.Forms.Button();
this .panel1.SuspendLayout();
this .panel2.SuspendLayout();
this .SuspendLayout();
this .panel1.Controls.Add(this .btnSpeakEnglish);
this .panel1.Controls.Add(this .cbWord);
this .panel1.Location = new System.Drawing.Point(12 , 12 );
this .panel1.Name = "panel1" ;
this .panel1.Size = new System.Drawing.Size(154 , 349 );
this .panel1.TabIndex = 0 ;
this .panel2.Controls.Add(this .button2);
this .panel2.Controls.Add(this .button1);
this .panel2.Controls.Add(this .txbExplaination);
this .panel2.Controls.Add(this .txbMeaning);
this .panel2.Location = new System.Drawing.Point(172 , 12 );
this .panel2.Name = "panel2" ;
this .panel2.Size = new System.Drawing.Size(391 , 349 );
this .panel2.TabIndex = 1 ;
this .txbMeaning.Location = new System.Drawing.Point(3 , 3 );
this .txbMeaning.Name = "txbMeaning" ;
this .txbMeaning.Size = new System.Drawing.Size(359 , 20 );
this .txbMeaning.TabIndex = 0 ;
this .txbExplaination.Location = new System.Drawing.Point(3 , 29 );
this .txbExplaination.Multiline = true ;
this .txbExplaination.Name = "txbExplaination" ;
this .txbExplaination.Size = new System.Drawing.Size(359 , 317 );
this .txbExplaination.TabIndex = 1 ;
this .cbWord.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
this .cbWord.FormattingEnabled = true ;
this .cbWord.Location = new System.Drawing.Point(12 , 3 );
this .cbWord.Name = "cbWord" ;
this .cbWord.Size = new System.Drawing.Size(112 , 332 );
this .cbWord.TabIndex = 0 ;
this .btnSpeakEnglish.BackgroundImage = global::SpeakDictionary.Properties.Resources.Kteam_vector_copy_2;
this .btnSpeakEnglish.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this .btnSpeakEnglish.Location = new System.Drawing.Point(130 , 3 );
this .btnSpeakEnglish.Name = "btnSpeakEnglish" ;
this .btnSpeakEnglish.Size = new System.Drawing.Size(20 , 23 );
this .btnSpeakEnglish.TabIndex = 1 ;
this .btnSpeakEnglish.UseVisualStyleBackColor = true ;
this .button1.BackgroundImage = global::SpeakDictionary.Properties.Resources.Kteam_vector_copy_2;
this .button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this .button1.Location = new System.Drawing.Point(368 , 3 );
this .button1.Name = "button1" ;
this .button1.Size = new System.Drawing.Size(20 , 23 );
this .button1.TabIndex = 2 ;
this .button1.UseVisualStyleBackColor = true ;
this .button2.BackgroundImage = global::SpeakDictionary.Properties.Resources.Kteam_vector_copy_2;
this .button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this .button2.Location = new System.Drawing.Point(368 , 323 );
this .button2.Name = "button2" ;
this .button2.Size = new System.Drawing.Size(20 , 23 );
this .button2.TabIndex = 3 ;
this .button2.UseVisualStyleBackColor = true ;
this .AutoScaleDimensions = new System.Drawing.SizeF(6 F, 13 F);
this .AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this .ClientSize = new System.Drawing.Size(575 , 373 );
this .Controls.Add(this .panel2);
this .Controls.Add(this .panel1);
this .Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon" )));
this .Name = "Form1" ;
this .Text = "Anh - Việt | Dictionary" ;
this .FormClosing += new System.Windows.Forms.FormClosingEventHandler(this .Form1_FormClosing);
this .panel1.ResumeLayout(false );
this .panel2.ResumeLayout(false );
this .panel2.PerformLayout();
this .ResumeLayout(false );
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnSpeakEnglish;
private System.Windows.Forms.ComboBox cbWord;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.TextBox txbExplaination;
private System.Windows.Forms.TextBox txbMeaning;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
}
}
Code Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SpeakDictionary
{
public partial class Form1 : Form
{
public Form1 ()
{
InitializeComponent();
}
private void Form1_FormClosing (object sender, FormClosingEventArgs e)
{
if (MessageBox.Show("Bạn có chắc chắn muốn thoát?" , "Thông báo" , MessageBoxButtons.OKCancel) != System.Windows.Forms.DialogResult.OK)
{
e.Cancel = true ;
}
}
}
}
Bài sau chúng ta sẽ cùng nhau tạo cấu trúc lưu trữ.
Đừng quên: “Luyện tập – Thử thách – Không ngại khó ”
Tải xuống
Tài liệu
Nhằm phục vụ mục đích học tập Offline của cộng đồng, Kteam hỗ trợ tính năng lưu trữ nội dung bài học Thiết kế giao diện dưới dạng file PDF trong link bên dưới.
Ngoài ra, bạn cũng có thể tìm thấy các tài liệu được đóng góp từ cộng đồng ở mục TÀI LIỆU trên thư viện Howkteam.com
Đừng quên like và share để ủng hộ Kteam và tác giả nhé!
Thảo luận
Nếu bạn có bất kỳ khó khăn hay thắc mắc gì về khóa học, đừng ngần ngại đặt câu hỏi trong phần BÌNH LUẬN bên dưới hoặc trong mục HỎI & ĐÁP trên thư viện Howkteam.com để nhận được sự hỗ trợ từ cộng đồng.
để cài phần mềm này mình làm như thế nào vậy ?