.NET Tips and Tricks

Blog archive

More on Working with Infragistics NetAdvantage WinClient

I continue to be impressed by the "little things" in Infragistic's WinClient controls bundle, reviewed in the January issue. For instance, I really liked the NetAdvantage UltraDropDownButton for Windows Forms (though it may just be because I'm working on an app with extremely limited screen space).

In the button's basic configuration, it's a button with a drop down arrow beside it. When the user clicks on the arrow, you can display an UltraPopupContainer holding a container with any control you want. Associating the container with the drop down requires a single line of code:

Me.ultraDropDownButton1.PopupItem = Me.ultraPopupControlContainer1

For my application, I used several of these buttons each displaying, as its Text, a typical date that a user might want to select. But for those cases where the user wanted a special date, I also had a DatePicker on my form that I assigned to the UltraPopupContainer tied to the buttons. If the user wants to accept the default date, they just click the button. When the user wants a "custom" date, they click the drop down arrow, get the standard Windows date picker and select a date they'd prefer. In the button's ClosedUp event, I set the button's Text property to reflect the new date:

Private Sub UltraDropDownButton1_ClosedUp(ByVal sender As Object, 
  ByVal e As System.EventArgs) Handles UltraDropDownButton1.ClosedUp
  Me.UltraDropDownButton1.Text = Me.DateTimePicker1.Text
End Sub

Without requiring any additional screen space, this control let me merge a control for triggering an action (the button) with a control to override my default settings (the DatePicker) without having to go to an "Options" form. Again, not a big, important control but one that solved my problem quickly and, I think, elegantly.

Posted by Peter Vogel on 01/18/2011


comments powered by Disqus

Featured

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

  • Copilot Agentic AI Dev Environment Opens Up to All

    Microsoft removed waitlist restrictions for some of its most advanced GenAI tech, Copilot Workspace, recently made available as a technical preview.

Subscribe on YouTube