Skip to content

Instantly share code, notes, and snippets.

@kainio
Created May 13, 2018 09:10
Show Gist options
  • Save kainio/1b794ab039b0e7e77df0b817cf1d7009 to your computer and use it in GitHub Desktop.
Save kainio/1b794ab039b0e7e77df0b817cf1d7009 to your computer and use it in GitHub Desktop.
Utilisation de colorDialog et fontDialog et openFileDialog
//Exemple colorDialog
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
label1.ForeColor = colorDialog1.Color;
}
//Exemple fontDialog
if (fontDialog1.ShowDialog() == DialogResult.OK)
{
label1.Font = fontDialog1.Font;
}
//Exemple openFileDialog
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
BackgroundImage = Image.FromFile(openFileDialog1.FileName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment