Skip to content

Commit

Permalink
Função de salvar a fonte atual quando o aplicativo fecha adicionada
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyHanauer committed Feb 22, 2023
1 parent 104ad67 commit b9f6461
Show file tree
Hide file tree
Showing 17 changed files with 10 additions and 8 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
10 changes: 6 additions & 4 deletions Bloco de notas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using Bloco_de_notas.Properties;
using System.Runtime;

namespace Bloco_de_notas
{
Expand All @@ -16,12 +18,11 @@ public partial class Bloco_de_notas : Form
private string texto;
private string caminho;
bool salvo = false;
//Font estiloFonteSalva = Properties.Settings.Default.fonteEstilo;
Font estiloFonteSalva = Settings.Default.fonteEstilo;

public Bloco_de_notas()
{
InitializeComponent();
//txtTexto.Font = estiloFonteSalva;
this.FormClosing += ConfirmarSaida;
this.Load += carregarBlocoDeNotas;
}
Expand All @@ -38,6 +39,7 @@ public FontFamily GetEstiloFonte()

private void carregarBlocoDeNotas(object sender, EventArgs e)
{
txtTexto.Font = Settings.Default.fonteEstilo;
string[] args = Environment.GetCommandLineArgs();
if (args.Length > 1)
{
Expand Down Expand Up @@ -110,8 +112,8 @@ private void EditarFonteEVT(object sender, EventArgs e)

private void ConfirmarSaida(object sender, FormClosingEventArgs e)
{
//EditarFonte editarFonteForm = new EditarFonte(txtTexto.Font.FontFamily, txtTexto.Font.Size);
//Properties.Settings.Default.fonteEstilo = editarFonteForm.NovaFonte();
Settings.Default.fonteEstilo = txtTexto.Font;
Settings.Default.Save();
if (salvo == false)
{
DialogResult ConfirmarSaida = MessageBox.Show("Salvar antes de sair?", "Confirmação", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
Expand Down
8 changes: 4 additions & 4 deletions Properties/Settings.Designer.cs

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

Binary file modified bin/Debug/Bloco de notas.exe
Binary file not shown.
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/DesignTimeResolveAssemblyReferences.cache
Binary file not shown.

0 comments on commit b9f6461

Please sign in to comment.