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