// Please use the following namespace
// using System.Windows.Forms;
// using GrapeCity.Win.Editors;
public void WirePopUpOpeningEvent()
{
GcNumber gcNumber1 = new GcNumber();
gcNumber1.PopUpOpening += new EventHandler<PopUpOpeningEventArgs>(OnNumberPopUpOpening);
}
private void OnNumberPopUpOpening(object sender, PopUpOpeningEventArgs e)
{
GcNumber gcNumber1 = sender as GcNumber;
if (gcNumber1 != null)
{
if (gcNumber1.InputStatus != InputStatus.Empty && gcNumber1.Value == null)
{
// Doesn't show the popup window when the value of the GcNumber control is null.
e.Cancel = true;
// Doesn't synchronize data from popup window to the GcNumber control.
e.SyncData = false;
}
}
}
' Please use the following namespace
' Imports System.Windows.Forms;
' Imports GrapeCity.Win.Editors;
Public Sub WirePopUpOpeningEvent()
Dim gcNumber1 As New GcNumber()
AddHandler gcNumber1.PopUpOpening, AddressOf OnNumberPopUpOpening
End Sub
Private Sub OnNumberPopUpOpening(ByVal sender As Object, ByVal e As PopUpOpeningEventArgs)
Dim gcNumber1 As GcNumber = TryCast(sender, GcNumber)
If (Not gcNumber1 Is Nothing) Then
If gcNumber1.InputStatus <> InputStatus.Empty AndAlso gcNumber1.Value = Nothing Then
' Doesn't show the popup window when the value of the GcNumber control is null.
e.Cancel = True
' Doesn't synchronize data from popup window to the GcNumber control.
e.SyncData = False
End If
End If
End Sub