updown control in wpf - wpf

I want to use a Similar control like domainUPDown control in my wpf application.
How to do the using infragistic or any other way.
I need a control like a textbox with up and down button.
How to do it?
That is ok, but i need tat up and down button for mouse click
Thanks,

With Infragistics use the XamNumericEditor control. The Up and Down arrow keys make the value change.

Related

Replicate default mouseover background color when a button is pressed

I am building a wpf ribbon application. When certain buttons are clicked on, I would like the background to remain "lit up" like when the mouse is over it. I don't want to change the default mouseover color, I just want to replicate it when the button is pressed for "modal" type commands. Is there a way to do this? In MFC programming it would be like adding the "BS_PUSHLIKE" style to the button where it remains lit while active. Thanks for any help you can provide.
I am not sure exactly what you are looking for, but I believe the equivalent of "BS_PUSHLIKE" in WPF is the ToggleButton control.

How to create WPF button that drops down a listBox

I'm trying to create a button in main window that would look like a globe, which would allow user to select his/her location. I want it to display a listBox when clicked on it just below the button itself.
Any hints on how to do this?
Probably the simplest way to do this is restyle a ComboBox and then restyle the ToggleButton in the ComboBox and remove the editable textbox.
This will avoid you having the implement the functions of the ComboBox for your popup.
Try using this as a starting point.
Another Approach would be to use the Expander Control with a list box in it
Link
OR
You could play with the Listbox's visibility property

WPF Custom Control: How to combine 2 controls into 1?

I need to create a WPF custom control that will combine a label and a textbox, the label being on the left and the textbox on the right, side by side. I need that kind of control because I'm working on forms that all have the same pattern: label + field to fill. This control would have a LabelContent property and Text property or something like that.
Any advices on how to put that all together?
Thanks
You might want to use a UserControl instead of a CustomControl. It is designed to allow you to compose other controls into a single, reusable control.

Trap keyboard input in a WindowsFormsHost control in WPF

I have an ActiveX control inside a WinForms user control. My WinForms app loves it!
Now, moving over to WPF, I use the user control in a WindowsFormsHost control. Works great..., but I want to treat this control as a single element so the user can neatly hit TAB over the existing WPF controls AND this user control NOT to 'go inside' it. i.e. just treat it as a single control like all the others.
I think what i need is the ability to trap the keys, and in the event handler simply move focus to the next control in the sequence, but I can't seem to trap any keyboard input. Ive tried the WPF PreviewKey.. events and the like, but once the tabbing gets to the control, it seems to stay inside it and WPF events are ignored.
I couldnt find anything on this in many WPF books and the net. Can anyone suggest a way ?
Thanks,
Jack.
Can't you create some sort of a filter by doing a preview mouse down on the panel or window (whatever is the parent of your controls), this way the panel will catch it before the user control and you should set e.handled to true, and if the user control raised the tab event, keep pushing the focus until you get another control. Preview and e.Handled=ture should solve the problem.

how can i change controls when a button is pressed in xaml

i am trying to create a wpf app and have different parts in user controls.
in the navigation i have some buttons (now using the ribbon ctp). is it possible to change the main user control when different buttons are pressed in xaml. or is this just a bad way to do things?
sorry, really new to xaml and im trying to get my head arround it.
Further to what Carlo has said,
The way we do it is to have a blank grid in the place you want your controls to all appear and then use BlankGrid.Children.Clear() and BlankGrid.Children.Add() to set up which control is visible in this position.
We found that was the nicest programatically as we have a large number of custom controls, but Carlo's method would work nicely if you wanted to use the designer.
I think this is a pretty regular procedure in WPF. In my experience, me and other programmers put the controls where we want to show them and make their visibility hidden, collapsed or visible depending on what we want to show the user.

Resources