.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

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube