Started Main form customisation

This commit is contained in:
2023-05-25 09:13:12 +02:00
parent 5421b5071b
commit 398466c671
6 changed files with 155 additions and 61 deletions
+20 -4
View File
@@ -13,7 +13,7 @@ using System.IO;
namespace Test_Merge
{
public partial class Form1 : Form
public partial class Main : Form
{
//private Reader Reader = null;
private F1TVEmulator Emulator = null;
@@ -24,7 +24,7 @@ namespace Test_Merge
string ConfigFile = "";
string GpUrl = "";
public Form1()
public Main()
{
InitializeComponent();
}
@@ -175,10 +175,10 @@ namespace Test_Merge
btnResetEmulator.Enabled = false;
btnStopUpdating.Text = "Stopping";
}
private async void button1_Click(object sender, EventArgs e)
{
btnResetEmulator.Text = "Restart driver";
lsbOvertakes.Items.Clear();
btnResetEmulator.Text = "Launching";
btnResetEmulator.Enabled = false;
btnSettings.Enabled = true;
btnStartDecoding.Enabled = false;
@@ -207,12 +207,28 @@ namespace Test_Merge
else
{
Wrapper = new DataWrapper(ConfigFile, Emulator.Screenshot());
btnResetEmulator.Text = "Re launch";
btnResetEmulator.Enabled = true;
btnSettings.Enabled = true;
btnStartDecoding.Enabled = true;
}
}
private void removeBorders(object sender, PaintEventArgs e)
{
GroupBox gpbx = (GroupBox)sender;
using (Pen pen = new Pen(gpbx.BackColor, 50))
{
e.Graphics.DrawRectangle(pen, 0, 0, gpbx.Width - 1, gpbx.Height - 1);
e.Graphics.DrawRectangle(pen, 0, 0, gpbx.Width - 1, gpbx.Height - 1);
}
using (var brush = new SolidBrush(gpbx.ForeColor))
{
var textPosition = new Point(5, 0); // Adjust the X and Y values as needed
e.Graphics.DrawString(gpbx.Text, gpbx.Font, brush, textPosition);
}
}
private void lsbPresets_SelectedIndexChanged(object sender, EventArgs e)
{
if (lsbPresets.SelectedIndex >= 0)