WPF Input Method Editor - wpf

I'm trying to enable the IME in WPF... which works for some textboxes but not the one I actually need it for. I do the following in XAML
InputMethod.IsInputMethodEnabled="True" InputMethod.PreferredImeConversionMode="Native" InputMethod.PreferredImeState="On"
I have a custom on-screen keyboard, the textbox has focus, and keys can be pushed on the screen and send the appropriate letter to the textbox. But when setting this above xaml to the textbox in this custom keyboard, the candidate window doesn't display at all, instead a strange small black control appears on the top left of the screen with a text box and a green arrow which has a caption of "Enter". Any text pressed on the keyboard goes to that small black control without showing the text, but after pressing enter, that text appears in my keyboard.
Ultimately I'm trying to incorporate simplified Chinese. Again, this works perfect on every other textbox but the one I actually need it for, being the custom onscreen keyboard.
Any thoughts? I'm really stuck with this.
Cheers.
UPDATE
This is the image I see, don't scroll down, it's the black little control with the green arrow.
http://babelstone.blogspot.ca/2010/05/prototyping-tangut-imes-or-why-windows.html

So I've been looking for a different design of the IME, Notepad seems to show something different. But I eventually got the little black box control to work and display what I'm actually typing. Moved xaml to code behind and it started working.

Related

How can I neatly line up right-aligned check boxes with with other controls?

The Visual Studio WinForms designer lets you snap together text boxes, list boxes, buttons, and so forth reasonably well. However, a check box with CheckAlign=MiddleRight does not work quite like the others, because it has two components: the built-in label, and the check box itself. If you line up the text with other labels, the check box is left floating and will not automatically line up. You can turn off AutoSize and attempt to size the CheckBox control so the check box lines up, but this is touchy and will be thrown off by custom font sizes.
In this example, I've almost lined up the check box with the other controls, but not quite:
If I had several check boxes it would be a real headache, as with AutoSize turned off the position of the check box is relative to the end of the text, so each control has to be individually sized pixel by pixel.
What's the best way to line up check boxes with other controls?
One workaround is to not include text with the CheckBox and instead have a separate Label control. However, by doing so you lose the ability to click on the label to toggle the check box. On a high-resolution screen, clicking a 10x10 pixel is finicky, a poor UX experience. You could add an OnClick event to the label, of course, but that seems like solving the wrong problem.
Here's an example of someone else with the same issue: in the preferences panel in Oracle SQL Developer, when there's a mix of properties the check boxes are handled with separate labels and boxes:
Personally, i avoid that issue by not having the CheckBoxes aligned to the right:
rather than having the caption on the left.

wpf Richtextbox selected text distorted

I am experimenting with the WPF RichTextBox and it shows some text in my application. I notice that When I select some text in that RichTextBox, the selected text gets distorted and the text below to that also gets distorted as shown below.
After I deselect that and scroll it comes back to normal.Is there anyway to avoid this distortion?
Now I solved this problem by myself. I just added the following single line of code in my application and make it works. We need to disable hardware acceleration in screen settings using this.
RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
This helped me a lot to fix my issue and it works for me.

Flood fill text based on a percentage in silverlight splash screen

I want to create a custom splash screen where some text on the page will end up being the progress bar. I need the text to flood fill with color from left to right based on the % loaded. My first thought (since I'm not use to doing this type of UI related stuff) was to have a textblock with the forecolor being trasparent layered over something like a border with its backcolor set and then grow the border control based on the %, but this is such a hack, there has to be something better with all the wonderful things silverlight can do. I had also thought about using a image so I could outline the text, but noticed the image was slow and was the last thing to load on my splash screen.
Any ideas on the right way to acomplish this?

text in paint like application

Hope I can make the question clear.
I am working on a paint like application where users can add different objects and also text. The way to add text is that we show a dialog where user can enter text and then that text is added to the draw area.
Now we want that text should be added in the same way as in Power Point. A user clicks any where in the draw area, a rectangular text entering area is shown, where user can enter text, format it, move the rectangle to move the text and then click outside to enter the text on the drawing area.
Since the paint event of the draw area is called and every object is added to the draw area using graphics and paint, what is the best way to add text using the interface as I explained above.
Any suggestions would be appreciated.
Your best option is to place a TextBox as a child control and that will allow the user to modify the text as required. Once they finish changing the text you then remove the text box and draw the string instead. If they click the text becaues they want to change it then you put the text box back again so they can edit it.

WPF: Changing the look of a Surface Listbox "click-effect"

I'm changing the look of some Controls that I use in my Microsoft Surface Application at the moment. And today I'm working on a SurfaceListBox.
I have the template for it and already changed background and borders and other stuff.
But I really cannot find where I can change the color of the rectangle that appears on the ListBoxItem when you touch the ListBox. At the moment it's just white and I want to change that.
It's not something like the effect that you can see when the item is selected. I already found that and changed that so my selected item now appears in a different color. But the effect in the second when you touch the item stays white.
So where can I change this effect?
If you mean the bright, white highlight that happens when you press your finger against an item you should look into the SurfaceShadowChrome. It's used by (almost) all surface controls to give feedback when the user is pressing on a control.
It does have a Color property that you can modify to suit your needs. Apart from the color, and the tweaking of corner radius and shadow offset, it's not a very flexible decorator. But hopefully, you'll be able to make it do what you need.

Resources