Skip to content

Commit

Permalink
Adicionada a função de lembrar a posição e tamanho da janela
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyHanauer committed Feb 27, 2023
1 parent a3cdec0 commit 85ca0ed
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/Bloco de notas/v17/.suo
Binary file not shown.
13 changes: 13 additions & 0 deletions App.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Bloco_de_notas.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<userSettings>
<Bloco_de_notas.Properties.Settings>
<setting name="windowPos" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="windowSize" serializeAs="String">
<value>0, 0</value>
</setting>
</Bloco_de_notas.Properties.Settings>
</userSettings>
</configuration>
14 changes: 14 additions & 0 deletions Bloco de notas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ private void CarregarBlocoDeNotas(object sender, EventArgs e)
salvo = true;
}
AtualizarIndicador(salvo);

if (Properties.Settings.Default.windowPos != null)
{
this.Location = Properties.Settings.Default.windowPos;
}

if (Properties.Settings.Default.windowSize != null)
{
this.Size = Properties.Settings.Default.windowSize;
}
}

private void ConfirmarSaida(object sender, FormClosingEventArgs e)
Expand All @@ -94,6 +104,10 @@ private void ConfirmarSaida(object sender, FormClosingEventArgs e)
e.Cancel = true;
}
}

Properties.Settings.Default.windowPos = this.Location;
Properties.Settings.Default.windowSize = this.Size;
Properties.Settings.Default.Save();
}

private void SalvarFonte(object sender, FormClosingEventArgs e)
Expand Down
24 changes: 24 additions & 0 deletions Properties/Settings.Designer.cs

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

6 changes: 6 additions & 0 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
<Setting Name="fonteEstilo" Type="System.Drawing.Font" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="windowPos" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting>
<Setting Name="windowSize" Type="System.Drawing.Size" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting>
</Settings>
</SettingsFile>
Binary file modified bin/Debug/Bloco de notas.exe
Binary file not shown.
13 changes: 13 additions & 0 deletions bin/Debug/Bloco de notas.exe.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Bloco_de_notas.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<userSettings>
<Bloco_de_notas.Properties.Settings>
<setting name="windowPos" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="windowSize" serializeAs="String">
<value>0, 0</value>
</setting>
</Bloco_de_notas.Properties.Settings>
</userSettings>
</configuration>
Binary file modified bin/Debug/Bloco de notas.pdb
Binary file not shown.
Binary file modified obj/Debug/Bloco de notas.csproj.GenerateResource.cache
Binary file not shown.
Binary file modified obj/Debug/Bloco de notas.exe
Binary file not shown.
Binary file modified obj/Debug/Bloco de notas.pdb
Binary file not shown.
Binary file modified obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Binary file not shown.

0 comments on commit 85ca0ed

Please sign in to comment.