Professional Documents
Culture Documents
TH 5 Lesson of Programming
TH 5 Lesson of Programming
المحاضرة الخامسة
sunny
Sunnyhealer9@gmail.com
نموذج بسيط محاكي للمفكرة ؟
namespace lecture03
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
استبدال النص //
1
حذف النص //
private void button2_Click(object sender, EventArgs e)
{
if (txt1.SelectionLength > 0)
{
txt1.Text = txt1.Text.Remove(txt1.SelectionStart, txt1.SelectionLength);
}
else
MessageBox.Show(";)"حذفه تريد الذي النص حدد
}
}
else
MessageBox.Show("not found");
2
البحث عن النص//
private void btn_search_Click(object sender, EventArgs e)
{
النسخ//
private void button5_Click(object sender, EventArgs e)
{
txt1.Copy();
//Clipboard.SetText(txt1.SelectedText);
}
اللصق //
private void button6_Click(object sender, EventArgs e)
{
txt2.Paste();
// txt2.Text = Clipboard.GetText();
}
قص//
private void btn_cut_Click(object sender, EventArgs e)
{
txt1.Cut();
//Clipboard.SetText(txt1.SelectedText);
//txt1.SelectedText = "";
}
طول النص//
private void btn_length_string_Click(object sender, EventArgs e)
{
MessageBox.Show("النص طول:"+txt1.TextLength);
}
3
طول النص المحدد//
private void btn_length_selected_string_Click(object sender, EventArgs e)
{
MessageBox.Show(" المحدد النص طول:" + txt1.SelectionLength);
}
تنظيف//
private void btn_clear_Click(object sender, EventArgs e)
{
txt1.Clear();
}
الغاء التحديد//
private void btn_cancle_select_Click(object sender, EventArgs e)
{
txt1.SelectionLength = 0;
}