Bind Client Size to Label : DataBinding Label « GUI Windows Forms « C# / CSharp Tutorial






using System;
using System.Drawing;
using System.Windows.Forms;

class WhatClientSize: Form
{
    [STAThread]
    public static void Main()
    {
        Application.EnableVisualStyles();
        Application.Run(new WhatClientSize());
    }
    public WhatClientSize()
    {
        Text = "What Client Size?";

        Label lbl = new Label();
        lbl.Parent = this;
        lbl.AutoSize = true;
        lbl.DataBindings.Add("Text", this, "ClientSize");
    }
}








23.80.DataBinding Label
23.80.1.Data binding to a programatically created dataset
23.80.2.Bind Client Size to Label