It wont full-screen :P
main.cs
using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
namespace namespace_DesktopTexter {
class class_Main {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.Run(new DesktopTexter());
}
}
}
DesktopTexter.cs
using System;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
namespace namespace_DesktopTexter {
public partial class DesktopTexter : Form {
public int FullScreen = 0;
CheckBox CheckBox_FullScreen = new CheckBox();
Panel Panel_Top = new Panel();
Panel Panel_Info = new Panel();
Label Label_FileName = new Label();
Label Label_FileExtension = new Label();
LinkLabel LinkLabel_About = new LinkLabel();
Label Label_FullScreen = new Label();
TextBox TextBox_FileName = new TextBox();
TextBox TextBox_FileExtension = new TextBox();
Button Button_SaveToDesktop = new Button();
RichTextBox RichTextBox_Content = new RichTextBox();
public DesktopTexter() {
this.Text = "Desktop Texter";
this.MinimumSize = new Size(290, 200);
if(FullScreen == 0) {
this.FormBorderStyle = FormBorderStyle.Sizable;
this.Size = new Size(450, 450);
}
if(FullScreen == 1) {
this.FormBorderStyle = FormBorderStyle.None;
this.Size = new Size(1024, 768);
}
RichTextBox_Content.Parent = this;
RichTextBox_Content.Dock = DockStyle.Fill;
RichTextBox_Content.TabIndex = 0;
Panel_Top.Parent = this;
Panel_Top.Dock = DockStyle.Top;
Panel_Top.Height = 55;
Panel_Info.Parent = this;
Panel_Info.Dock = DockStyle.Bottom;
Panel_Info.Height = 20;
Label_FileName.Parent = Panel_Top;
Label_FileName.Location = new Point(5, 8);
Label_FileName.AutoSize = true;
Label_FileName.Text = "Filename:";
Label_FileExtension.Parent = Panel_Top;
Label_FileExtension.Location = new Point(5, 33);
Label_FileExtension.AutoSize = true;
Label_FileExtension.Text = "File extension:";
LinkLabel_About.Parent = Panel_Info;
LinkLabel_About.Location = new Point(3, 3);
LinkLabel_About.AutoSize = true;
LinkLabel_About.Text = "About Desktop Texter";
LinkLabel_About.TabStop = false;
LinkLabel_About.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkLabel_About_Click);
Label_FullScreen.Parent = Panel_Info;
Label_FullScreen.Location = new Point(this.Width - 90, 4);
Label_FullScreen.AutoSize = true;
Label_FullScreen.TabStop = false;
Label_FullScreen.Anchor = AnchorStyles.Right;
if(FullScreen == 0) {
Label_FullScreen.Text = "Full Screen";
}
if(FullScreen == 1) {
Label_FullScreen.Text = "Window";
}
CheckBox_FullScreen.Parent = Panel_Info;
CheckBox_FullScreen.Location = new Point(this.Width - 23, 0);
CheckBox_FullScreen.TabStop = false;
CheckBox_FullScreen.Anchor = AnchorStyles.Right;
if(!CheckBox_FullScreen.Checked)
FullScreen = 0;
if(CheckBox_FullScreen.Checked)
FullScreen = 1;
TextBox_FileName.Parent = Panel_Top;
TextBox_FileName.Location = new Point(60, 5);
TextBox_FileName.Width -= 25;
TextBox_FileExtension.Parent = Panel_Top;
TextBox_FileExtension.Location = new Point(85, 30);
TextBox_FileExtension.Width -= 50;
TextBox_FileExtension.Text = "txt";
Button_SaveToDesktop.Parent = Panel_Top;
Button_SaveToDesktop.Location = new Point(139, 16);
Button_SaveToDesktop.Text = "Save to Desktop";
Button_SaveToDesktop.AutoSize = true;
Button_SaveToDesktop.Click += new EventHandler(Button_SaveToDesktop_Click);
}
void Button_SaveToDesktop_Click(object sender, EventArgs click) {
SaveToDesktop(TextBox_FileName.Text, RichTextBox_Content.Text, TextBox_FileExtension.Text);
}
void LinkLabel_About_Click(object sender, LinkLabelLinkClickedEventArgs click) {
Information();
}
}
}
Methods.cd
using System;
using System.IO;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
namespace namespace_DesktopTexter{
public partial class DesktopTexter {
void SaveToDesktop(string Meth_Filename, string Meth_Content, string Meth_FileExtension) {
if(Meth_Filename != "") {
if(Meth_FileExtension == "") {
if(File.Exists("C:/Documents and Settings/Tomas/Skrivebord/" + Meth_Filename + ".txt")) {
File.Delete("C:/Documents and Settings/Tomas/Skrivebord/" + Meth_Filename + ".txt");
}
File.AppendAllText("C:/Documents and Settings/Tomas/Skrivebord/" + Meth_Filename + ".txt", Meth_Content);
MessageBox.Show("Used default extension \".txt\"", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
if(Meth_FileExtension != "") {
if(File.Exists("C:/Documents and Settings/Tomas/Skrivebord/" + Meth_Filename + "." + Meth_FileExtension)) {
File.Delete("C:/Documents and Settings/Tomas/Skrivebord/" + Meth_Filename + "." + Meth_FileExtension);
}
File.AppendAllText("C:/Documents and Settings/Tomas/Skrivebord/" + Meth_Filename + "." + Meth_FileExtension, Meth_Content);
}
}
if(Meth_Filename == "") {
if(Meth_FileExtension == "") {
if(File.Exists("C:/Documents and Settings/Tomas/Skrivebord/" + "file" + ".txt")) {
File.Delete("C:/Documents and Settings/Tomas/Skrivebord/" + "file" + ".txt");
}
File.AppendAllText("C:/Documents and Settings/Tomas/Skrivebord/" + "file" + ".txt", Meth_Content);
MessageBox.Show("Used default filename \"file.txt\"", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
if(Meth_FileExtension != "") {
if(File.Exists("C:/Documents and Settings/Tomas/Skrivebord/" + "file" + "." + Meth_FileExtension)) {
File.Delete("C:/Documents and Settings/Tomas/Skrivebord/" + "file" + "." + Meth_FileExtension);
}
File.AppendAllText("C:/Documents and Settings/Tomas/Skrivebord/" + "file" + "." + Meth_FileExtension, Meth_Content);
MessageBox.Show("Used default filename \"file.txt\"", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
void Information() {
MessageBox.Show(
"Made by Tomas Sandven\n\nFreeware",
"Inforation",
MessageBoxButtons.OK,
MessageBoxIcon.Information
);
}
}
}

