.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 at 1:16 PM


comments powered by Disqus

Featured

  • Black White Wave IMage

    Neural Regression Using PyTorch: Training

    The goal of a regression problem is to predict a single numeric value, for example, predicting the annual revenue of a new restaurant based on variables such as menu prices, number of tables, location and so on.

  • Microsoft Ships Visual Studio 2019 v16.9 Servicing Baseline Release

    Microsoft is urging enterprises and professional coders to standardize on the new Visual Studio 2019 v16.9, a servicing baseline release that's guaranteed to receive official support for an extended period.

  • Microsoft Extends Low-Code Push with Power Fx Programming Language

    "Using formulas that are already familiar to hundreds of millions of users, Power Fx allows a broad range of people to bring skills they already know to low code solutions."

  • Microsoft's Tools to Fight Solorigate Attack Are Now Open Source

    Microsoft open sourced homegrown tools it used to check its systems for code related to the recent massive breach of supply chains that the company has named Solorigate.

Upcoming Events