Nevron .NET Vision
Caption Buttons

Being completely custom our forms allow you to specify your own caption buttons and to respond to their "Click" event. You may either specify and image set to be used by the button or to select a common glyph to be displayed.
Adding Buttons

The following code demonstrates how to add custom caption button on a NForm instance:

Copy Code
//create a frame caption button 
NFrameCaptionButton button = new NFrameCaptionButton();
button.Glyph = CommonGlyphs.PinDown;
button.GlyphSize = new Size(8, 10);

//create a new form and add our button to it
NForm form = new NForm();
Visual Basic
Copy Code
'create a frame caption button 
Dim button As NFrameCaptionButton = New NFrameCaptionButton()
button.Glyph = CommonGlyphs.PinDown
button.GlyphSize = New Size(8, 10)

'create a new form and add our button to it
Dim form As NForm = New NForm()

The result of the above code:


Trapping The Click Event

The following example demonstrates how to trap a click from a custom caption button:

Copy Code
NForm form = new NForm();
form.CaptionButtonClicked += new NUIItemEventHandler(OnCaptionButtonClicked);


private void OnCaptionButtonClicked(object sender, NUIItemEventArgs e)
Visual Basic
Copy Code
Dim form As NForm = New NForm()
AddHandler CaptionButtonClicked, AddressOf OnCaptionButtonClicked


Private Sub OnCaptionButtonClicked(ByVal sender As Object, ByVal e As NUIItemEventArgs) Handles form.CaptionButtonClicked
End Sub
Note that the CaptionButtonClicked event will be fired only for non-system (custom) buttons.
See Also



©2022. Nevron Software LLC.

Send Feedback