MFC. ComboBox. ScrollBar Thumd doesn't show actual position - combobox

I create comboBox with these settings (from .rc file):
COMBOBOX IDC_COMBO_NAME,6,24,96,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
But when i open my combobox and try to scroll by mouse wheel :
Content of combobox is scrolled, thumb of scrollbar - stay on the same place.
The same behaviour when i press scrollbar's arrow controls.
How can i trace the reason of such behaviour and fix it. Or maybe it well-known problem and have solution.

When you created the combo box control in the resource editor, did you forget to size its height by dragging down on the arrow key? Can you post a picture of what your combo looks like at run time?

Related

Changing the look of the Button Part Of A RadioButton Silverlight

I have been looking on the net for some way to change the look of a basic radiobutton in silverlight. Say I want the actual button to have a blue border and a yellow background. And when its checked I want the little circle that fills in the radio button to be red. I wanna do this for the radio button on the windows phone.
Take a look at this article to do it in raw XAML:
http://msdn.microsoft.com/en-us/library/cc189093(v=vs.95).aspx
If you have Expression Blend, it can automatically generate the control's default XAML style for you to customize. Right click on the element and click Edit Template | Edit a Copy...

How to position a menubar above TextBox in Silverlight?

I want to add the menubar to TextBox control in Silverlight 4. (I will create a new reusable control.) The menubar will consists of a few image buttons. The idea is that it will normally stay hidden and will show up only when the user puts his/her mouse cursor to the TextBox area. If used in a multiline textbox, whole menubar can fit inside it, this should be easy. (I hope. :-))
But how to solve situation when TextBox is in single line mode? I'd like to put the menubar above the TextBox. But I don't have a clue how to do it. Can somebody help? I need to let all other controls in a form to stay in their positions, and only add my menubar above my textbox. (So the menubar will NOT hide the textbox. Instead, it will hide other controls residing right above the textbox.) It should work in all arrangements of form, like Grid, StackPanel, Canvas etc. In the fact it would be similar to a classic right-click context menu, but not modal. (Right-click context menu is modal, i.e. while it is shown you cannot use other controls, and it automatically hides when you click anywhere else. I want my menubar to stay visible as long as user heeps mouse cursor over the textbox or the menubar.)
Example: Coordinates of textbox are top=100,left=20,bottom=115,right=120. So my menubar's coordinates should be bottom=100,left=20, right & top are based on size of menubar.
If many textboxes will be used on a single page, each single one should have its own menubar. (Of course.)
You can create your own control (custom control or UserControl, whichever you like should work) which has the TextBox, and the visual for the menu bar.
If the TextBox is single-line, you could display the menu bar in a Popup which you position just above the TextBox whenever the mouse is over it.
If the TextBox is multi-line, you'd simply use a StackPanel or Grid or whatever to do layout like normal, if I am understanding what you want.
No coding required if you use this menu:
http://sl4popupmenu.codeplex.com
To achieve this behavior you will need to set its IsPinned property to true.

wpfToolkit : DataGrid Double click issue

I am using wpfToolkit:DataGrid in my application.
If I tried to doubleclick on the corner of selectedrow ,It gives null value.
But If I click in the middle of the selectedrow I am able to get the cell value.
Kindly help me to get the selectedrow cell value irrespective of by dobule clicking any place of the selectedrow.
Try giving your cell a background color. Quite often the default background color of WPF controls is transparent, so they do not register things like Click events. For example, a TextBlock with a DoubleClick event to copy the text will only work if you double-click on the text itself and not any of the whitespace around it unless you set a background color.
This will also show you if the area you are clicking on is considered part of the Cell or if it is just Margin/Padding

Silverlight light dropdown

I have a Silverlight form that contains a Stack Panel (orientation = vertical) with 10 rows. Each row contains a TextBlock and Textbox control except the last row has a TextBlock and Drowdown.. At the bottom of the control are two buttons. Previous & Continue.
There are 10 items in the Dropdown. When I select a value from the Dropdown, only two of the ten items are showing up. I believe that the remaining items aren't displying because there's some sort of clipping effect going on. Fair enough.
Does Silverlight allow the dropdown control to display upwards (instead of the default down direction)? Will I have to override some rendering capabiliities before the dropdown is rendered to the control or is there a property that allows me to accomplish this functionality?
The Silverlight ComboBox auto aligns the dropdown popup to always be visible whenever possible.
all Popup based controls (ComboBox, AutoCompleteBox, DatePicker and TimePicker) all have this feature enabled.
So if there's not enough screen real-estate below the ComboBox to show the dropdown popup, it'll show up above the control.
The combobox nesting in the visual tree should not affect the dropdown popup auto alignment. The internal Popup control (inside the ComboBox) ignores the Visual Tree and is nested "above" the visual tree.
If you have specific issues, please share minimal and relevant XAML. Since Keith is on this thread, I think it's safe to say he'll log a bug if needed.

WPF changing button background color when the window is disabled

I have a button with a transparent background on a wpf window.
Problem is, when I open up another window with a .showdialog the form becomes disabled as does the button, causing the button to go white (and stick out like a sore thumb); the same happens to the listview and textbox controls. Labels and group boxes aren't impacted in this way and remain looking fine.
How do I preserve the transparency color of the button, listview and textboxes when they are disabled?
Thanks, Rob
I'm not sure what your button template looks like, I would recommend posting your XAML. But check out the MSDN Docs on Button Templating

Resources