بسم الاب والابن والروح القدوس
درس اليوم هو
حصريا برمجة مفكرة احترافية بكود واحد من الجوكر المصري
الاكواد المستخدمة
Public Class Form1
Private WithEvents _new As New Button
Private WithEvents _open As New Button
Private WithEvents _save As New Button
Private WithEvents _exit As New Button
Private WithEvents _selectall As New Button
Private WithEvents _paste As New Button
Private WithEvents _copy As New Button
Private WithEvents _cut As New Button
Private WithEvents _clear As New Button
Private WithEvents _undo As New Button
Private WithEvents _font As New Button
Private WithEvents _textcolor As New Button
Private WithEvents _backcolor As New Button
Private WithEvents _newwindow As New Button
Private WithEvents _restartprogram As New Button
Private WithEvents _about As New Button
Private WithEvents _textbox As New TextBox
Private WithEvents _opentext As New OpenFileDialog
Private WithEvents _savetext As New SaveFileDialog
Private WithEvents _textfont As New FontDialog
Private WithEvents _tbcolor As New ColorDialog
Private WithEvents _left As New Button
Private WithEvents _right As New Button
Private WithEvents _center As New Button
Private Sub _left_click() Handles _left.Click
_textbox.TextAlign = HorizontalAlignment.Left
End Sub
Private Sub _right_click() Handles _right.Click
_textbox.TextAlign = HorizontalAlignment.Right
End Sub
Private Sub _center_click() Handles _center.Click
_textbox.TextAlign = HorizontalAlignment.Center
End Sub
Private Sub _new_click() Handles _new.Click
_textbox.Text = ""
End Sub
Private Sub _open_click() Handles _open.Click
_opentext.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If _opentext.ShowDialog = Windows.Forms.DialogResult.OK Then
_textbox.Text = IO.File.ReadAllText(_opentext.FileName)
End If
End Sub
Private Sub _save_click() Handles _save.Click
_savetext.FileName = "New"
_savetext.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If _savetext.ShowDialog = Windows.Forms.DialogResult.OK Then
IO.File.WriteAllText(_savetext.FileName, _textbox.Text)
End If
End Sub
Private Sub _exit_click() Handles _exit.Click
End
End Sub
Private Sub _selectall_click() Handles _selectall.Click
_textbox.SelectAll()
End Sub
Private Sub _paste_click() Handles _paste.Click
_textbox.Paste()
End Sub
Private Sub _copy_click() Handles _copy.Click
_textbox.Copy()
End Sub
Private Sub _cut_click() Handles _cut.Click
_textbox.Cut()
End Sub
Private Sub _undo_click() Handles _undo.Click
_textbox.Undo()
End Sub
Private Sub _clear_click() Handles _clear.Click
_textbox.Text = ""
End Sub
Private Sub _font_click() Handles _font.Click
_textfont.Font = _textbox.Font
If _textfont.ShowDialog = Windows.Forms.DialogResult.OK Then
_textbox.Font = _textfont.Font
End If
End Sub
Private Sub _textcolor_click() Handles _textcolor.Click
_tbcolor.Color = _textbox.ForeColor
If _tbcolor.ShowDialog = Windows.Forms.DialogResult.OK Then
_textbox.ForeColor = _tbcolor.Color
End If
End Sub
Private Sub _backcolor_click() Handles _backcolor.Click
_tbcolor.Color = _textbox.BackColor
If _tbcolor.ShowDialog = Windows.Forms.DialogResult.OK Then
_textbox.BackColor = _tbcolor.Color
End If
End Sub
Private Sub _restartprogram_click() Handles _restartprogram.Click
Application.Restart()
End Sub
Private Sub _newwindow_click() Handles _newwindow.Click
End Sub
Private Sub _about_click() Handles _about.Click
MsgBox("تمت البرمجة من قبل الجوكر المصري", MsgBoxStyle.Information, "About")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
On Error Resume Next
ForeColor = Color.Black
FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
MaximizeBox = False
Font = New Font("Arial", 9, FontStyle.Italic)
Text = "المفكرة الاحترافية"
Height = 587
Width = 645
_textbox.Multiline = True
_textbox.ScrollBars = ScrollBars.Vertical
_textbox.MaxLength = 0
_textbox.Top = 60
_textbox.Height = 500
_textbox.Width = 640
_textbox.Font = New Font("Courier New", 14, FontStyle.Regular)
Controls.Add(_textbox)
_new.Top = 0
_new.Left = 0
_new.Height = 30
_new.Width = 80
_new.Text = "New"
Controls.Add(_new)
_open.Top = 0
_open.Left = 80
_open.Height = 30
_open.Width = 80
_open.Text = "Open"
Controls.Add(_open)
_save.Top = 0
_save.Left = 160
_save.Height = 30
_save.Width = 80
_save.Text = "Save"
Controls.Add(_save)
_font.Top = 0
_font.Left = 240
_font.Height = 30
_font.Width = 80
_font.Text = "Font"
Controls.Add(_font)
_textcolor.Top = 0
_textcolor.Left = 320
_textcolor.Height = 30
_textcolor.Width = 80
_textcolor.Text = "Text Color"
Controls.Add(_textcolor)
_backcolor.Top = 0
_backcolor.Left = 400
_backcolor.Height = 30
_backcolor.Width = 80
_backcolor.Text = "Back Color"
Controls.Add(_backcolor)
_about.Top = 0
_about.Left = 480
_about.Height = 30
_about.Width = 80
_about.Text = "About"
Controls.Add(_about)
_undo.Top = 0
_undo.Left = 560
_undo.Height = 30
_undo.Width = 80
_undo.Text = "Undo"
Controls.Add(_undo)
_selectall.Top = 30
_selectall.Left = 0
_selectall.Height = 30
_selectall.Width = 80
_selectall.Text = "select All"
Controls.Add(_selectall)
_paste.Top = 30
_paste.Left = 80
_paste.Height = 30
_paste.Width = 80
_paste.Text = "Paste"
Controls.Add(_paste)
_copy.Top = 30
_copy.Left = 160
_copy.Height = 30
_copy.Width = 80
_copy.Text = "Copy"
Controls.Add(_copy)
_cut.Top = 30
_cut.Left = 240
_cut.Height = 30
_cut.Width = 80
_cut.Text = "Cut"
Controls.Add(_cut)
_left.Top = 30
_left.Left = 320
_left.Height = 30
_left.Width = 80
_left.Text = "Left"
Controls.Add(_left)
_center.Top = 30
_center.Left = 400
_center.Height = 30
_center.Width = 80
_center.Text = "Center"
Controls.Add(_center)
_right.Top = 30
_right.Left = 480
_right.Height = 30
_right.Width = 80
_right.Text = "Right"
Controls.Add(_right)
_exit.Top = 30
_exit.Left = 560
_exit.Height = 30
_exit.Width = 80
_exit.Text = "Exit"
Controls.Add(_exit)
End Sub
End Class
مشاهدة ممتعة
تحويل كودإخفاء محول الأكواد الإبتساماتإخفاء