custom-controls

WPF: How do I make a custom modal dialog flash?

微笑、不失礼 提交于 2019-12-01 18:05:58
Normally when you open a Modal Dialog and try to click on it's parent window the Modal Dialog's titlebar flashes. When creating a custom, borderless, chromeless, window in WPF you lose all that functionality and must rebuild it yourself. I've looked high and low and for the life of me cannot figure out how to get my Modal window to flash. Though it still beeps... I figure I'm going to have to watch for some event(s) in WndProc that I'll have to handle, but I can't figure out which event or how to do it. I've tried watching the window changed and window changing event as well as the WM_ACTIVATE

Why won't my control accept keyboard input?

走远了吗. 提交于 2019-12-01 18:03:47
I've built a custom control that I'm trying to send input to. It will accept mouse input and report MouseDown, MouseMove and MouseUp correctly, but for whatever reason, it won't accept keyboard input. When I click on it, it doesn't receive focus, and any keys I press get interpreted by whatever control had the focus already. This is probably something really simple. The first place I thought to look was in the ControlStyle property, but the only thing I can see in the helpfile about keyboard input is csNoStdEvents , which disables it, and my control doesn't have that. So what do I need to do

Why won't my control accept keyboard input?

女生的网名这么多〃 提交于 2019-12-01 17:57:33
问题 I've built a custom control that I'm trying to send input to. It will accept mouse input and report MouseDown, MouseMove and MouseUp correctly, but for whatever reason, it won't accept keyboard input. When I click on it, it doesn't receive focus, and any keys I press get interpreted by whatever control had the focus already. This is probably something really simple. The first place I thought to look was in the ControlStyle property, but the only thing I can see in the helpfile about keyboard

WPF: How do I make a custom modal dialog flash?

五迷三道 提交于 2019-12-01 17:56:09
问题 Normally when you open a Modal Dialog and try to click on it's parent window the Modal Dialog's titlebar flashes. When creating a custom, borderless, chromeless, window in WPF you lose all that functionality and must rebuild it yourself. I've looked high and low and for the life of me cannot figure out how to get my Modal window to flash. Though it still beeps... I figure I'm going to have to watch for some event(s) in WndProc that I'll have to handle, but I can't figure out which event or

Arrow key events not arriving

与世无争的帅哥 提交于 2019-12-01 17:41:20
问题 Basically, I have a form with a custom control on it (and nothing else). The custom control is completely empty, and the form has KeyPreview set to true. With this setup, I am not receiving any KeyDown events for any arrow keys or Tab. Every other key that I have on my keyboard works. I have KeyDown event handlers hooked up to everything that has such events, so I'm sure I'm not missing anything. Also of note is that if I remove the (completely empty) custom control, I DO get the arrow key

Arrow key events not arriving

梦想与她 提交于 2019-12-01 17:25:23
Basically, I have a form with a custom control on it (and nothing else). The custom control is completely empty, and the form has KeyPreview set to true. With this setup, I am not receiving any KeyDown events for any arrow keys or Tab. Every other key that I have on my keyboard works. I have KeyDown event handlers hooked up to everything that has such events, so I'm sure I'm not missing anything. Also of note is that if I remove the (completely empty) custom control, I DO get the arrow key events. What on earth is going on here? EDIT: I added this to both the form and the control, but I'm

BlackBerry - ButtonField with centered Bitmap

懵懂的女人 提交于 2019-12-01 14:40:12
I have a class that extends from ButtonField : class BitmapButtonField extends ButtonField { private Bitmap _bitmap; private int _buttonWidth; private int _buttonHeight; BitmapButtonField(Bitmap bitmap, int buttonWidth, int buttonHeight, long style) { super(style); _buttonWidth = buttonWidth; _buttonHeight = buttonHeight; _bitmap = bitmap; } public int getPreferredHeight() { return _buttonHeight; } public int getPreferredWidth() { return _buttonWidth; } protected void layout(int width, int height) { setExtent(Math.min( width, getPreferredWidth()), Math.min( height, getPreferredHeight())); }

Center subitem Icon in ListView

帅比萌擦擦* 提交于 2019-12-01 13:42:41
I would like to center the icon in one of my columns. The way I currently add icons is by calling the AddIconToSubitem method after the row has been created. How would I modify my custom control to also center the icon? Thanks Public Class ListViewSubIcons : Inherits System.Windows.Forms.ListView Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal Msg As Int32, ByVal

Access additional twitter user info

这一生的挚爱 提交于 2019-12-01 13:28:12
I'm using Azure Mobile Services to authorize users and am now trying to get additional user info from the providers. I have it working for all of them except Twitter. To authenticate for all the other I'm using something similar to this: var identities = await user.GetIdentitiesAsync(); var result = new JObject(); var fb = identities.OfType<FacebookCredentials>().FirstOrDefault(); if (fb != null) { var accessToken = fb.AccessToken; result.Add("facebook", await GetProviderInfo("https://graph.facebook.com/me?access_token=" + accessToken)); } Would I be able to do something like this: var tw =

Bind to wpf custom control dependency property for tooltip?

感情迁移 提交于 2019-12-01 13:17:01
I have a custom control I wrote in WPF, which has a Boolean dependency property: public static readonly DependencyProperty IsAlertProperty = DependencyProperty.Register("IsAlert", typeof(bool), typeof(AlertControl), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.None, OnIsAlertChanged, null, false, UpdateSourceTrigger.PropertyChanged)); public bool IsAlert { get { return (bool)GetValue(IsAlertProperty); } set { SetValue(IsAlertProperty, value); } } In my Generic.xaml, I have the following xaml code: <Style TargetType="{x:Type local:AlertControl}"> <Setter