GrapeCity.Win.Bars 名前空間 : ThumbValueChangedEventArgs クラス |
Public Class ThumbValueChangedEventArgs Inherits System.EventArgs
public class ThumbValueChangedEventArgs : System.EventArgs
次のサンプルコードは、GcTrackBar コントロールを含むフォームを表示し、ThumbValueChanged イベントを処理する例を示します。このサンプルを実行するには、TextBox1 という名前の System.Windows.Forms.TextBox コントロールを含むフォームに以下のコードを貼り付けて、フォームのコンストラクターまたは System.Windows.Forms.Form.Load イベント処理メソッドから CreateGcTrackBarWithValueChanged メソッドを呼び出します。
private void CreateGcTrackBarWithValueChanged() { // Create a instance of GcTrackBar. GrapeCity.Win.Bars.GcTrackBar gcTrackBar2 = new GrapeCity.Win.Bars.GcTrackBar(); // Initialize the Name, Location and Size of GcTrackBar gcTrackBar2.Name = "gcTrackBar2"; gcTrackBar2.Location = new System.Drawing.Point(8, 8); gcTrackBar2.Size = new System.Drawing.Size(224, 45); gcTrackBar2.ThumbValueChanged += new EventHandler<ThumbValueChangedEventArgs>(gcTrackBar2_ThumbValueChanged); // Set tool tip for the default thumb GrapeCity.Win.Bars.Thumb thumb1 = gcTrackBar2.Thumbs[0]; thumb1.ToolTip = "#0\\%"; // Add the second Thumb to the Thumbs of GcTrackBar GrapeCity.Win.Bars.Thumb thumb2 = new GrapeCity.Win.Bars.Thumb(); thumb2.ToolTip = "#0cm"; thumb2.Value = 1; gcTrackBar2.Thumbs.Add(thumb2); // Add gcTrackBar1 to the form this.Controls.Add(gcTrackBar2); } void gcTrackBar2_ThumbValueChanged(object sender, ThumbValueChangedEventArgs e) { // Display the changed NewValaue of current selected Thumb in the text box. this.textBox1.Text = "" + e.NewValue; }
Private Sub CreateGcTrackBarWithValueChanged() ' Create a instance of GcTrackBar. Dim gcTrackBar2 As New GcTrackBar() ' Initialize the Name, Location and Size of GcTrackBar gcTrackBar2.Name = "gcTrackBar2" gcTrackBar2.Location = New System.Drawing.Point(8, 8) gcTrackBar2.Size = New System.Drawing.Size(224, 45) AddHandler gcTrackBar2.ThumbValueChanged, AddressOf gcTrackBar2_ThumbValueChanged ' Set tool tip for the default thumb Dim thumb1 As Thumb = gcTrackBar2.Thumbs(0) thumb1.ToolTip = "#0\%" ' Add the second Thumb to the Thumbs of GcTrackBar Dim thumb2 As New Thumb() thumb2.ToolTip = "#0cm" thumb2.Value = 1 gcTrackBar2.Thumbs.Add(thumb2) ' Add gcTrackBar1 to the form Me.Controls.Add(gcTrackBar2) End Sub Private Sub gcTrackBar2_ThumbValueChanged(ByVal sender As Object, ByVal e As ThumbValueChangedEventArgs) ' Display the changed NewValaue of current selected Thumb in the text box. Me.textBox1.Text = "" + e.NewValue.ToString() End Sub
System.Object
System.EventArgs
GrapeCity.Win.Bars.ThumbValueChangedEventArgs
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2