whiplk

[Executável] - C# Color Picker

May 4th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. //Color picker C#
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11.  
  12. namespace WindowsFormsApplication1
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void pictureBox1_DoubleClick(object sender, EventArgs e)
  22.         {
  23.             if (colorDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  24.             {
  25.                 pictureBox1.BackColor = colorDialog1.Color;
  26.                 string c;
  27.                 c = string.Format("0x{0:X8}", pictureBox1.BackColor.ToArgb());
  28.                 c = c.Remove(c.IndexOf("x") + 1, 2);
  29.                 textBox1.Text = c + "FF";
  30.             }
  31.         }
  32.  
  33.         private void Form1_Load(object sender, EventArgs e)
  34.         {
  35.             MessageBox.Show("Você está usando um programa teste feito por Willian_Luigi, obrigado pela preferência.");
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment