MainForm.cs
author sl
Sat, 14 Jun 2014 12:51:25 +0200
changeset 0 f6eca6facd07
child 2 f516c3f656bf
permissions -rw-r--r--
First contrib.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Linq;
     7 using System.Text;
     8 using System.Threading.Tasks;
     9 using System.Windows.Forms;
    10 using CodeProject.Dialog;
    11 
    12 namespace SharpDisplayManager
    13 {
    14     public partial class MainForm : Form
    15     {
    16         public MainForm()
    17         {
    18             InitializeComponent();
    19         }
    20 
    21         private void buttonFont_Click(object sender, EventArgs e)
    22         {
    23             //fontDialog.ShowColor = true;
    24             //fontDialog.ShowApply = true;
    25             fontDialog.ShowEffects = true;
    26             //fontDialog.ShowHelp = true;
    27 
    28             //fontDlg.MaxSize = 40;
    29             //fontDlg.MinSize = 22;
    30 
    31             //fontDialog.Parent = this;
    32             //fontDialog.StartPosition = FormStartPosition.CenterParent;
    33 
    34             //DlgBox.ShowDialog(fontDialog);
    35 
    36             //if (fontDialog.ShowDialog(this) != DialogResult.Cancel)
    37             if (DlgBox.ShowDialog(fontDialog) != DialogResult.Cancel)
    38             {
    39 
    40                 MsgBox.Show("MessageBox MsgBox", "MsgBox caption");
    41 
    42                 //MessageBox.Show("Ok");
    43                 //textBox1.Font = fontDlg.Font;
    44                 //label1.Font = fontDlg.Font;
    45                 //textBox1.BackColor = fontDlg.Color;
    46                 //label1.ForeColor = fontDlg.Color;
    47             }
    48         }
    49 
    50         private void buttonCapture_Click(object sender, EventArgs e)
    51         {
    52             System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(tableLayoutPanel.Width, tableLayoutPanel.Height);
    53             tableLayoutPanel.DrawToBitmap(bmp, tableLayoutPanel.ClientRectangle);
    54             bmp.Save("c:\\capture.png");
    55         }
    56     }
    57 }