removed the border around the text box and fixed the "Open With" function

This commit is contained in:
Brendan 2024-05-31 22:32:59 +02:00
parent e16091be31
commit 4c52a98373
6 changed files with 57 additions and 17 deletions

View File

@ -34,7 +34,7 @@
this.label1.Name = "label1"; this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(63, 39); this.label1.Size = new System.Drawing.Size(63, 39);
this.label1.TabIndex = 0; this.label1.TabIndex = 0;
this.label1.Text = "V_EditorPro\nVersion 1.0\nOS: "; this.label1.Text = "V_EditorPro\nVersion 1.1\nOS: ";
// //
// pictureBox1 // pictureBox1
// //

View File

@ -12,7 +12,7 @@ namespace V_EditorPro
{ {
InitializeComponent(); InitializeComponent();
label1.Text = $"V_EditorPro\nVersion 1.0\nOS: {RuntimeInformation.OSDescription}"; label1.Text = $"V_EditorPro\nVersion 1.1\nOS: {RuntimeInformation.OSDescription}";
} }
private void pictureBox1_Click(object sender, EventArgs e) private void pictureBox1_Click(object sender, EventArgs e)

View File

@ -8,12 +8,18 @@ namespace V_EditorPro
{ {
public partial class MainForm : Form public partial class MainForm : Form
{ {
public MainForm() public MainForm(string filePath = null)
{ {
InitializeComponent(); InitializeComponent();
this.KeyPreview = true; this.KeyPreview = true;
this.KeyDown += new KeyEventHandler(MainForm_KeyDown); this.KeyDown += new KeyEventHandler(MainForm_KeyDown);
if (!string.IsNullOrEmpty(filePath))
{
OpenFile(filePath);
} }
}
private void MainForm_KeyDown(object sender, KeyEventArgs e) private void MainForm_KeyDown(object sender, KeyEventArgs e)
{ {
@ -53,6 +59,11 @@ namespace V_EditorPro
} }
} }
private void OpenFile(string filePath)
{
richTextBox1.Text = File.ReadAllText(filePath);
}
private void OpenFile() private void OpenFile()
{ {
OpenFileDialog openFileDialog = new OpenFileDialog(); OpenFileDialog openFileDialog = new OpenFileDialog();
@ -60,7 +71,7 @@ namespace V_EditorPro
if (openFileDialog.ShowDialog() == DialogResult.OK) if (openFileDialog.ShowDialog() == DialogResult.OK)
{ {
richTextBox1.Text = File.ReadAllText(openFileDialog.FileName); OpenFile(openFileDialog.FileName);
} }
} }

View File

@ -13,11 +13,24 @@ namespace V_EditorPro
/// Der Haupteinstiegspunkt für die Anwendung. /// Der Haupteinstiegspunkt für die Anwendung.
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() static void Main(string[] args)
{ {
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
if (args.Length > 0)
{
// A file was passed as an argument
string filePath = args[0];
// Create the main form and pass the file path to it
Application.Run(new MainForm(filePath));
}
else
{
// No file was passed as an argument
Application.Run(new MainForm()); Application.Run(new MainForm());
}
} }
} }
} }

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben: // indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0")] [assembly: AssemblyVersion("1.1")]
[assembly: AssemblyFileVersion("1.0")] [assembly: AssemblyFileVersion("1.1")]

View File

@ -34,13 +34,13 @@
"Entry" "Entry"
{ {
"MsmKey" = "8:_UNDEFINED" "MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_1A77597F4F993247A0CA6D5211C05EBC" "OwnerKey" = "8:_A75A53BE905D4A018ADE2B8AC1A2FDC6"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
} }
"Entry" "Entry"
{ {
"MsmKey" = "8:_UNDEFINED" "MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_A75A53BE905D4A018ADE2B8AC1A2FDC6" "OwnerKey" = "8:_1A77597F4F993247A0CA6D5211C05EBC"
"MsmSig" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED"
} }
} }
@ -61,6 +61,14 @@
"PrivateKeyFile" = "8:" "PrivateKeyFile" = "8:"
"TimeStampServer" = "8:" "TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2" "InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
}
} }
"Release" "Release"
{ {
@ -77,6 +85,14 @@
"PrivateKeyFile" = "8:" "PrivateKeyFile" = "8:"
"TimeStampServer" = "8:" "TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2" "InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
}
} }
} }
"Deployable" "Deployable"
@ -224,25 +240,25 @@
{ {
"Name" = "8:Microsoft Visual Studio" "Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:V_EditorPro" "ProductName" = "8:V_EditorPro"
"ProductCode" = "8:{9ABC1146-4460-4B64-8EA7-67A6C84ABD05}" "ProductCode" = "8:{64E2E37D-4A9B-437E-9157-AABB371475C4}"
"PackageCode" = "8:{FA271E47-F355-4580-A852-7CCCB9758C8E}" "PackageCode" = "8:{FDC36702-BC29-4516-8565-8D0652AC8033}"
"UpgradeCode" = "8:{56851E53-0DA5-4A43-A552-A4F5B5FD39C5}" "UpgradeCode" = "8:{56851E53-0DA5-4A43-A552-A4F5B5FD39C5}"
"AspNetVersion" = "8:2.0.50727.0" "AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE" "RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE" "RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE" "InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.0" "ProductVersion" = "8:1.1"
"Manufacturer" = "8:abrendan" "Manufacturer" = "8:abrendan"
"ARPHELPTELEPHONE" = "8:" "ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:" "ARPHELPLINK" = "8:https://www.abrendan.dev"
"Title" = "8:V_EditorPro Setup" "Title" = "8:V_EditorPro Setup"
"Subject" = "8:" "Subject" = "8:"
"ARPCONTACT" = "8:abrendan" "ARPCONTACT" = "8:abrendan"
"Keywords" = "8:" "Keywords" = "8:"
"ARPCOMMENTS" = "8:Simple Editor Application" "ARPCOMMENTS" = "8:Simple Editor Application"
"ARPURLINFOABOUT" = "8:https://www.abrendan.dev" "ARPURLINFOABOUT" = "8:https://www.abrendan.dev"
"ARPPRODUCTICON" = "8:" "ARPPRODUCTICON" = "8:_D89D93AB9EAB41DA9DF11044540DCF65"
"ARPIconIndex" = "3:0" "ARPIconIndex" = "3:0"
"SearchPath" = "8:" "SearchPath" = "8:"
"UseSystemSearchPath" = "11:TRUE" "UseSystemSearchPath" = "11:TRUE"
@ -760,7 +776,7 @@
{ {
"{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A75A53BE905D4A018ADE2B8AC1A2FDC6" "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_A75A53BE905D4A018ADE2B8AC1A2FDC6"
{ {
"SourcePath" = "8:..\\V_EditorPro\\obj\\Debug\\V_EditorPro.exe" "SourcePath" = "8:..\\V_EditorPro\\obj\\Release\\V_EditorPro.exe"
"TargetName" = "8:" "TargetName" = "8:"
"Tag" = "8:" "Tag" = "8:"
"Folder" = "8:_5C85C7D260D04E449FC9F8A71E91C827" "Folder" = "8:_5C85C7D260D04E449FC9F8A71E91C827"