The carriage is moved to the end of the line

This commit is contained in:
Sigmanor 2016-01-10 14:32:08 +02:00
parent a19d6a6852
commit 93ab03d9da
2 changed files with 23 additions and 17 deletions

View file

@ -634,6 +634,7 @@ public void InitializeComponent()
this.MainMenuStrip = this.MainMenu;
this.MinimumSize = new System.Drawing.Size(500, 300);
this.Name = "MainWindow";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Crypto Notepad";
this.Activated += new System.EventHandler(this.MainWindow_Activated);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWindow_FormClosing);

View file

@ -1,6 +1,7 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.NetworkInformation;
@ -19,7 +20,7 @@ public partial class MainWindow : Form
public static string key = "";
public static bool keyChanged = false;
public static bool settingsChanged = false;
public static int textSave = 0;
public static bool textSave = false;
public static string[] args = Environment.GetCommandLineArgs();
Properties.Settings ps = Properties.Settings.Default;
@ -40,11 +41,11 @@ void SaltMAC()
if (ps.FirstLaunch == false)
{
DialogResult res = new DialogResult();
using (new CenterWinDialog(this))
{
//using (new CenterWinDialog(this))
//{
res = MessageBox.Show("Get The Salt from mac address? (You can edit it by himself in Settings)", "The Salt",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
//}
if (res == DialogResult.Yes)
{
@ -118,8 +119,6 @@ void SaltMAC()
{
Cikil = 1;
}
}
if (dialogResult == DialogResult.Cancel)
@ -130,16 +129,17 @@ void SaltMAC()
} while (Cikil == 1);
filename = OpenFile.FileName;
textSave = 0;
customRTB.Select(0, 0);
textSave = false;
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
customRTB.Select(Convert.ToInt32(cc), 0);
return;
}
filename = OpenFile.FileName;
textSave = 0;
customRTB.Select(0, 0);
textSave = false;
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
customRTB.Select(Convert.ToInt32(cc2), 0);
}
private void openAsotiations()
@ -204,8 +204,9 @@ private void openAsotiations()
}
filename = args[1];
textSave = 0;
customRTB.Select(0, 0);
textSave = false;
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
customRTB.Select(Convert.ToInt32(cc), 0);
}
@ -264,7 +265,9 @@ private void openAsotiations()
sw.Close();
customRTB.Text = noenc;
toolStripStatusLabel1.Text = "Saved in: " + filename;
textSave = 0;
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
customRTB.Select(Convert.ToInt32(cc), 0);
textSave = false;
await Task.Delay(4000);
toolStripStatusLabel1.Text = "Ready";
@ -280,7 +283,7 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
ps.RichWrap = customRTB.WordWrap;
ps.Save();
if (textSave == 1)
if (textSave == true)
{
string f = "Unnamed.enp";
if (customRTB.Text != "")
@ -399,10 +402,12 @@ private void MainWindow_Load(object sender, EventArgs e)
sw.Close();
customRTB.Text = noenc;
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
customRTB.Select(Convert.ToInt32(cc), 0);
textSave = false;
toolStripStatusLabel1.Text = "Saved in: " + filename;
await Task.Delay(4000);
toolStripStatusLabel1.Text = "Ready";
textSave = 0;
}
private void выходToolStripMenuItem_Click(object sender, EventArgs e)
@ -636,7 +641,7 @@ private void customRTB_SelectionChanged_1(object sender, EventArgs e)
private void customRTB_TextChanged(object sender, EventArgs e)
{
textSave = 1;
textSave = true;
LineAndColumn();
}