About the Creating a toolbar of globe tools Sample
[C#]
TextForm.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace GlobeGraphicsToolbar { public partial class TextForm : Form { private string _inputText; public TextForm() { InitializeComponent(); } private void textBox_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { _inputText = this.textBox1.Text; this.Close(); } else if (e.KeyCode == Keys.Escape) { this.Close(); } } public string InputText { get { return _inputText; } } } }
[Visual Basic .NET]
TextForm.vb
Imports Microsoft.VisualBasic Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Text Imports System.Windows.Forms Namespace GlobeGraphicsToolbar Partial Public Class TextForm Inherits Form Private _inputText As String Public Sub New() InitializeComponent() End Sub Private Sub textBox_KeyUp(ByVal sender As Object, ByVal e As KeyEventArgs) Handles textBox1.KeyUp If e.KeyCode = Keys.Enter Then _inputText = Me.textBox1.Text Me.Close() ElseIf e.KeyCode = Keys.Escape Then Me.Close() End If End Sub Public ReadOnly Property InputText() As String Get Return _inputText End Get End Property End Class End Namespace