// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void WirePopUpClosingEvent()
{
GcNumber gcNumber1 = new GcNumber();
gcNumber1.PopUpClosing += new EventHandler<PopUpClosingEventArgs>(OnNumberPopUpClosing);
}
private void OnNumberPopUpClosing(object sender, PopUpClosingEventArgs e)
{
if (e.Value is decimal && (decimal)e.Value < 0)
{
// If the value of the popup window less than zero, it's not synchornizes the data.
e.SyncData = false;
}
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub WirePopUpClosingEvent()
Dim gcNumber1 As New GcNumber()
AddHandler gcNumber1.PopUpClosing, AddressOf OnNumberPopUpClosing
End Sub
Private Sub OnNumberPopUpClosing(ByVal sender As Object, ByVal e As PopUpClosingEventArgs)
If TypeOf e.Value Is Decimal AndAlso DirectCast(e.Value, Decimal) < 0 Then
' If the value of the popup window less than zero, it's not synchornizes the data.
e.SyncData = False
End If
End Sub