Form.OnInputLanguageChanged : Form « System.Windows.Forms « C# / C Sharp by API






Form.OnInputLanguageChanged

  


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class InternationalText : System.Windows.Forms.Form {
    internal System.Windows.Forms.Label lblInternationalText;
    internal System.Windows.Forms.Label lblCharCode;
    private System.Windows.Forms.TextBox textBox1;
    public InternationalText() {
        this.lblInternationalText = new System.Windows.Forms.Label();
        this.lblCharCode = new System.Windows.Forms.Label();
        this.textBox1 = new System.Windows.Forms.TextBox();
        this.SuspendLayout();

        this.lblInternationalText.Location = new System.Drawing.Point(8, 64);
        this.lblInternationalText.Size = new System.Drawing.Size(288, 23);

        this.lblCharCode.Location = new System.Drawing.Point(8, 96);
        this.lblCharCode.Size = new System.Drawing.Size(88, 23);

        this.textBox1.Location = new System.Drawing.Point(8, 24);
        this.textBox1.Size = new System.Drawing.Size(288, 20);
        this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);

        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(304, 134);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                      this.textBox1,
                                                                      this.lblCharCode,
                                                                      this.lblInternationalText});
        this.MaximizeBox = false;
        this.ResumeLayout(false);

    }
    [STAThread]
    static void Main() {
        Application.Run(new InternationalText());
    }

    protected override void OnInputLanguageChanged(InputLanguageChangedEventArgs e) {
        MessageBox.Show(e.InputLanguage.Culture.Name);
    }

    protected override void OnInputLanguageChanging(InputLanguageChangingEventArgs e) {
        MessageBox.Show(e.InputLanguage.Culture.Name);
    }

    private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) {
        lblInternationalText.Text += e.KeyChar.ToString();
        lblCharCode.Text = ((int)e.KeyChar).ToString();
    }
}

   
    
  








Related examples in the same category

1.new Form()
2.extends Form
3.Form.AcceptButton
4.Form.ActiveForm.Location
5.Form.Activated
6.Form.AddOwnedForm
7.Form.AutoScaleBaseSize
8.Form.AutoScroll
9.Form.AutoScrollMinSize
10.Form.BackColor
11.Form.CancelButton
12.Form.CenterToScreen()
13.Form.ClientRectangle
14.Form.ClientSize
15.Form.Closed
16.Form.Closing
17.Form.ContextMenu
18.Form.ControlBox
19.Form.Controls
20.Form.Cursor
21.Form.DesktopBounds
22.Form.DialogResult
23.Form.DisplayRectangle
24.Form.Dispose
25.Form.FormBorderStyle
26.Form.ForeColor
27.Form.GotFocus
28.Form.Height
29.Form.Hide()
30.Form.Invalidate
31.Form.IsMdiContainer
32.Form.KeyPress
33.Form.KeyPreview
34.Form.KeyUp
35.Form.Load
36.Form.Location
37.Form.MaximizeBox
38.Form.MaximumSize
39.Form.MdiParent
40.Form.MenuComplete
41.Form.Menu
42.Form.MinimizeBox
43.Form.MinimumSize
44.Form.MouseDown
45.Form.MouseLeave(All other events)
46.Form.MouseUp
47.Form.OnDragDrop
48.Form.OnDragOver
49.Form.OnKeyDown
50.Form.OnKeyPress
51.Form.OnMouseEnter
52.Form.OnMouseHover
53.Form.OnMouseLeave
54.Form.OnMouseMove
55.Form.OnMouseWheel
56.Form.OnPaint(PaintEventArgs e)
57.Form.OnResize
58.Form.Opacity
59.Form.Paint
60.Form.Region
61.Form.Resize
62.Form.ResizeRedraw
63.Form.SetStyle
64.Form.ShowInTaskbar
65.Form.Size
66.Form.Show
67.Form.StartPosition
68.Form.SuspendLayout
69.Form.Text
70.Form.Top
71.Form.TransparencyKey
72.Form.Visible
73.Form.Width
74.Form.WindowState