ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
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;using System.IO;namespace New_Notepad{ public partial class Form1 : Form { string filePath = ""; // Used to store the file location public Form1() { InitializeComponent(); } private void newToolStripMenuItem_Click(object sender, EventArgs e) { filePath = ""; richTextBox1.Text = ""; } private void openToolStripMenuItem_Click(object sender, EventArgs e) { //Code for open a txt file using (OpenFileDialog ofd=new OpenFileDialog(){Filter="TextDocument|*.txt",ValidateNames=true,Multiselect=false}) { if (ofd.ShowDialog()==DialogResult.OK) { using (StreamReader sr=new StreamReader(ofd.FileName)) { filePath = ofd.FileName; Task text = sr.ReadToEndAsync(); richTextBox1.Text = text.Result; } } } } private void saveToolStripMenuItem_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(filePath)) { using(SaveFileDialog sfd=new SaveFileDialog(){Filter="Textdocument|*.txt",ValidateNames=true}) { if(sfd.ShowDialog()==DialogResult.OK) { using(StreamWriter sw=new StreamWriter(sfd.FileName)) { sw.WriteLineAsync(richTextBox1.Text); } } } } else{ using(StreamWriter sw=new StreamWriter(filePath)) { sw.WriteLineAsync(richTextBox1.Text); } } } private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { //We can also use the save file coding here using (SaveFileDialog sfd = new SaveFileDialog() { Filter = "Textdocument|*.txt", ValidateNames = true }) { if (sfd.ShowDialog() == DialogResult.OK) { using (StreamWriter sw = new StreamWriter(sfd.FileName)) { sw.WriteLineAsync(richTextBox1.Text); } } } } private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e) { printPreviewDialog1.Document = printDocument1; printPreviewDialog1.ShowDialog(); } private void printToolStripMenuItem_Click(object sender, EventArgs e) { printPreviewDialog1.Document = printDocument1; if (printDialog1.ShowDialog()==DialogResult.OK) { printDocument1.Print(); } } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { //To close the application this.Close(); } private void undoToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Undo(); } private void redoToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Redo(); } private void cutToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Cut(); } private void copyToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Copy(); } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.Paste(); } private void deleteToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.SelectedText = ""; } private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.SelectAll(); } private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e) { if (wordWrapToolStripMenuItem.Checked==true) { wordWrapToolStripMenuItem.Checked = false; richTextBox1.WordWrap = false; } else { wordWrapToolStripMenuItem.Checked = true; richTextBox1.WordWrap = true; } } private void fontToolStripMenuItem_Click(object sender, EventArgs e) { fontDialog1.ShowDialog(); richTextBox1.SelectionFont = new Font(fontDialog1.Font.FontFamily, fontDialog1.Font.Size, fontDialog1.Font.Style); } private void highlightTextToolStripMenuItem_Click(object sender, EventArgs e) { richTextBox1.SelectionBackColor = Color.Yellow; } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { About About = new About(); About.ShowDialog(); } private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.DrawString(richTextBox1.Text,richTextBox1.Font,Brushes.Black,12,10); } private void richTextBox1_TextChanged(object sender, EventArgs e) { if (richTextBox1.Text.Length>0) { cutToolStripMenuItem.Enabled = true; copyToolStripMenuItem.Enabled = true; } else { cutToolStripMenuItem.Enabled = false; copyToolStripMenuItem.Enabled = false; } } }}
Thank you Teacher this assignment whose sent me in ky university ana i just completed all design and their codes thanks you so much.
Welcome
thanks for assignment completion ...god bless you
Thank you
thank you very much my friend
Always welcome
thank you so much bro very helpfull keep it up
Nice Information
Thank you for your support...
Thank you very very very Much
Thank you 😍
Thanks for English subtitles...
Thank you so much
Blogspot : dotnetintamils.blogspot.com/2021/06/create-notepad-using-c.html
super bro, very very awesome i was searching for this video only, now I am a subscriber of your channel
Thank you so much bro
@@codingwithlibino teaching coding in Tamil is rare thanks for helping 😁👍👍👍❤️❤️
@@codingwithlibino thanks for sharing bro
Hey Bro, while making videos, just zoom in to your codes while writing codes... Its not clearly visible... Btw keep posting such good content bro....
Thank you for your suggestions.
I'm fresher..... Can u suggest me which book is good to learn the content and suggest more multiple examples.
Really Awesum
TH-cam
add video for traffic signal program using c#
👍
16:52
Sadly, the code didn't work on my Microsoft Visual Studio 2022 :< But thanks for the tutorial.
Thank you bro although the about code is not helping me but Thank you
Exit and Cut the same shortcut Ctrl + X
You can also use your own alphabets.
35:11
Bhai code nai hai description main
It is placed in the comment section
19:26
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;
using System.IO;
namespace New_Notepad
{
public partial class Form1 : Form
{
string filePath = ""; // Used to store the file location
public Form1()
{
InitializeComponent();
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
filePath = "";
richTextBox1.Text = "";
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
//Code for open a txt file
using (OpenFileDialog ofd=new OpenFileDialog(){Filter="TextDocument|*.txt",ValidateNames=true,Multiselect=false})
{
if (ofd.ShowDialog()==DialogResult.OK)
{
using (StreamReader sr=new StreamReader(ofd.FileName))
{
filePath = ofd.FileName;
Task text = sr.ReadToEndAsync();
richTextBox1.Text = text.Result;
}
}
}
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(filePath))
{
using(SaveFileDialog sfd=new SaveFileDialog(){Filter="Textdocument|*.txt",ValidateNames=true})
{
if(sfd.ShowDialog()==DialogResult.OK)
{
using(StreamWriter sw=new StreamWriter(sfd.FileName))
{
sw.WriteLineAsync(richTextBox1.Text);
}
}
}
}
else{
using(StreamWriter sw=new StreamWriter(filePath))
{
sw.WriteLineAsync(richTextBox1.Text);
}
}
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
//We can also use the save file coding here
using (SaveFileDialog sfd = new SaveFileDialog() { Filter = "Textdocument|*.txt", ValidateNames = true })
{
if (sfd.ShowDialog() == DialogResult.OK)
{
using (StreamWriter sw = new StreamWriter(sfd.FileName))
{
sw.WriteLineAsync(richTextBox1.Text);
}
}
}
}
private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
{
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
printPreviewDialog1.Document = printDocument1;
if (printDialog1.ShowDialog()==DialogResult.OK)
{
printDocument1.Print();
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
//To close the application
this.Close();
}
private void undoToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Undo();
}
private void redoToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Redo();
}
private void cutToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Cut();
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Copy();
}
private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.Paste();
}
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.SelectedText = "";
}
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.SelectAll();
}
private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e)
{
if (wordWrapToolStripMenuItem.Checked==true)
{
wordWrapToolStripMenuItem.Checked = false;
richTextBox1.WordWrap = false;
}
else
{
wordWrapToolStripMenuItem.Checked = true;
richTextBox1.WordWrap = true;
}
}
private void fontToolStripMenuItem_Click(object sender, EventArgs e)
{
fontDialog1.ShowDialog();
richTextBox1.SelectionFont = new Font(fontDialog1.Font.FontFamily, fontDialog1.Font.Size, fontDialog1.Font.Style);
}
private void highlightTextToolStripMenuItem_Click(object sender, EventArgs e)
{
richTextBox1.SelectionBackColor = Color.Yellow;
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
About About = new About();
About.ShowDialog();
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString(richTextBox1.Text,richTextBox1.Font,Brushes.Black,12,10);
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
if (richTextBox1.Text.Length>0)
{
cutToolStripMenuItem.Enabled = true;
copyToolStripMenuItem.Enabled = true;
}
else
{
cutToolStripMenuItem.Enabled = false;
copyToolStripMenuItem.Enabled = false;
}
}
}
}
Thank you Teacher this assignment whose sent me in ky university ana i just completed all design and their codes thanks you so much.
Welcome
thanks for assignment completion ...god bless you
Thank you
thank you very much my friend
Always welcome
thank you so much bro very helpfull
keep it up
Nice Information
Thank you for your support...
Thank you very very very Much
Thank you 😍
Thanks for English subtitles...
Thank you so much
Blogspot : dotnetintamils.blogspot.com/2021/06/create-notepad-using-c.html
super bro, very very awesome i was searching for this video only, now I am a subscriber of your channel
Thank you so much bro
@@codingwithlibino teaching coding in Tamil is rare thanks for helping 😁👍👍👍❤️❤️
Blogspot : dotnetintamils.blogspot.com/2021/06/create-notepad-using-c.html
@@codingwithlibino thanks for sharing bro
Hey Bro, while making videos, just zoom in to your codes while writing codes... Its not clearly visible... Btw keep posting such good content bro....
Thank you for your suggestions.
Blogspot : dotnetintamils.blogspot.com/2021/06/create-notepad-using-c.html
I'm fresher..... Can u suggest me which book is good to learn the content and suggest more multiple examples.
Really Awesum
TH-cam
Blogspot : dotnetintamils.blogspot.com/2021/06/create-notepad-using-c.html
add video for traffic signal program using c#
👍
Thank you for your support...
16:52
Sadly, the code didn't work on my Microsoft Visual Studio 2022 :< But thanks for the tutorial.
Thank you bro although the about code is not helping me but Thank you
Exit and Cut the same shortcut Ctrl + X
You can also use your own alphabets.
Blogspot : dotnetintamils.blogspot.com/2021/06/create-notepad-using-c.html
35:11
Bhai code nai hai description main
It is placed in the comment section
Blogspot : dotnetintamils.blogspot.com/2021/06/create-notepad-using-c.html
19:26