Skip to content

Commit

Permalink
tried to fix windows resizing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayzAe committed Aug 28, 2024
1 parent 8b9d725 commit d751e1e
Show file tree
Hide file tree
Showing 17 changed files with 1,781 additions and 49 deletions.
104 changes: 59 additions & 45 deletions currency converter/Form1.Designer.cs

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions currency converter/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public Form1()
button1.Click += ButtonSendMoney_Click;

// Attach the click event handler to the "Resources" button
button2.Click += ButtonSendMoney_Click;
button2.Click += ButtonResources_Click;

// Attach the click event handler to the "Tools" button
button3.Click += ButtonTools_Click;
}

private void addUserControl(UserControl userControl)
Expand Down Expand Up @@ -111,7 +114,7 @@ private void CustomizeGetTheAppButton(Button button)
// Change background color when clicked
button.MouseDown += (sender, e) =>
{
button.BackColor = Color.LightGray;
button.BackColor = Color.DarkGray;
button.Invalidate(); // Redraw the button
};

Expand Down Expand Up @@ -165,6 +168,14 @@ private void ButtonResources_Click(object sender, EventArgs e)
addUserControl(uS_Resources);
}

private void ButtonTools_Click(object sender, EventArgs e)
{

US_tools usS_Tools = new US_tools();
addUserControl(usS_Tools);

}

// Other event handlers
private void Form1_Load(object sender, EventArgs e)
{
Expand Down Expand Up @@ -205,5 +216,10 @@ private void button7_Click(object sender, EventArgs e)
{

}

private void pictureBox1_Click(object sender, EventArgs e)
{

}
}
}
1,435 changes: 1,435 additions & 0 deletions currency converter/Form1.resx

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion currency converter/UserControls/US_resources.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Drawing;
using System.Windows.Forms;

namespace currency_converter.UserControls
Expand All @@ -9,8 +10,22 @@ public US_resources()
{
InitializeComponent();

CustomizeBackButton(button9);


button9.Click += ButtonBack_Click; // Assuming button9 is the back button
button9.Click += ButtonBack_Click; // button9 is the back button
}

private void CustomizeBackButton(Button button)
{
button.FlatStyle = FlatStyle.Flat;
button.BackColor = Color.Transparent;
button.FlatAppearance.BorderSize = 0; // Remove the border

// Ensure the button size is appropriate for the image
int buttonSize = 50;
button.Size = new Size(buttonSize, buttonSize);

}

private void ButtonBack_Click(object sender, EventArgs e)
Expand Down
80 changes: 80 additions & 0 deletions currency converter/UserControls/US_tools.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions currency converter/UserControls/US_tools.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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;

namespace currency_converter.UserControls
{
public partial class US_tools : UserControl
{
public US_tools()
{
InitializeComponent();

CustomizeBackButton(button10tools);

button10tools.Click += buttonBack_Click;
}

private void CustomizeBackButton(Button button)
{

button.FlatStyle = FlatStyle.Flat;
button.BackColor = Color.Transparent;
button.FlatAppearance.BorderSize = 0; // Remove the border

// Ensure the button size is appropriate for the image
int buttonSize = 50;
button.Size = new Size(buttonSize, buttonSize);

}

private void buttonBack_Click(object sender, EventArgs e)
{
this.Parent.Controls.Remove(this);
}
}
}
120 changes: 120 additions & 0 deletions currency converter/UserControls/US_tools.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
Binary file modified currency converter/bin/Debug/currency converter.exe
Binary file not shown.
Binary file modified currency converter/bin/Debug/currency converter.pdb
Binary file not shown.
9 changes: 9 additions & 0 deletions currency converter/currency converter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
<Compile Include="UserControls\US_sendmoney.Designer.cs">
<DependentUpon>US_sendmoney.cs</DependentUpon>
</Compile>
<Compile Include="UserControls\US_tools.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControls\US_tools.Designer.cs">
<DependentUpon>US_tools.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -85,6 +91,9 @@
<EmbeddedResource Include="UserControls\US_sendmoney.resx">
<DependentUpon>US_sendmoney.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserControls\US_tools.resx">
<DependentUpon>US_tools.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
afb272c9c601451b14d220942929e9a3c9957d3d7c832fa6a3e06904d8c83489
e69727b42fb32034b888d161fb47937da3c11e175ee2b88ae3f95943d5932428
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ C:\Users\Moses\Desktop\Coding\Projects\wpf test\currency converter\currency conv
C:\Users\Moses\Desktop\Coding\Projects\wpf test\currency converter\currency converter\obj\Debug\currency converter.pdb
C:\Users\Moses\Desktop\Coding\Projects\wpf test\currency converter\currency converter\obj\Debug\currency_converter.UserControls.US_sendmoney.resources
C:\Users\Moses\Desktop\Coding\Projects\wpf test\currency converter\currency converter\obj\Debug\currency_converter.UserControls.US_resources.resources
C:\Users\Moses\Desktop\Coding\Projects\wpf test\currency converter\currency converter\obj\Debug\currency_converter.UserControls.US_tools.resources
Binary file not shown.
Binary file modified currency converter/obj/Debug/currency converter.exe
Binary file not shown.
Binary file modified currency converter/obj/Debug/currency converter.pdb
Binary file not shown.
Binary file modified currency converter/obj/Debug/currency_converter.Form1.resources
Binary file not shown.
Binary file not shown.

0 comments on commit d751e1e

Please sign in to comment.