GrapeCity.Win.Components 名前空間 > GcTouchToolBarProvider クラス : SetEnableTouchEvents メソッド |
次のサンプルコードは、このプロパティの使用方法を示します。
このサンプルコードは、GcTouchToolBarProvider クラスに示されている詳細なコード例の一部を抜粋したものです。
private void EnableOrDisableTouchEvents(object sender, EventArgs e) { if (gcTouchToolBarProvider1.GetEnableTouchEvents(label1)) { gcTouchToolBarProvider1.SetEnableTouchEvents(label1, false); gcTouchToolBarProvider1.Tapped -= gcTouchToolBarProvider1_Tapped; gcTouchToolBarProvider1.RightTapped -= gcTouchToolBarProvider1_RightTapped; } else { gcTouchToolBarProvider1.SetEnableTouchEvents(label1, true); gcTouchToolBarProvider1.Tapped += gcTouchToolBarProvider1_Tapped; gcTouchToolBarProvider1.RightTapped += gcTouchToolBarProvider1_RightTapped; } } void gcTouchToolBarProvider1_RightTapped(object sender, Components.TouchEventArgs e) { MessageBox.Show(@"RightTapped!"); } void gcTouchToolBarProvider1_Tapped(object sender, Components.TouchEventArgs e) { MessageBox.Show(@"Tapped!"); }
Private Sub EnableOrDisableTouchEvents(sender As Object, e As EventArgs) If gcTouchToolBarProvider1.GetEnableTouchEvents(label1) Then gcTouchToolBarProvider1.SetEnableTouchEvents(label1, False) RemoveHandler gcTouchToolBarProvider1.Tapped, AddressOf gcTouchToolBarProvider1_Tapped RemoveHandler gcTouchToolBarProvider1.RightTapped, AddressOf gcTouchToolBarProvider1_RightTapped Else gcTouchToolBarProvider1.SetEnableTouchEvents(label1, True) AddHandler gcTouchToolBarProvider1.Tapped, AddressOf gcTouchToolBarProvider1_Tapped AddHandler gcTouchToolBarProvider1.RightTapped, AddressOf gcTouchToolBarProvider1_RightTapped End If End Sub Private Sub gcTouchToolBarProvider1_RightTapped(sender As Object, e As Components.TouchEventArgs) MessageBox.Show("RightTapped!") End Sub Private Sub gcTouchToolBarProvider1_Tapped(sender As Object, e As Components.TouchEventArgs) MessageBox.Show("Tapped!") End Sub
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