custom-controls

How to hit detect on a null or transparent background?

百般思念 提交于 2020-01-03 17:38:55
问题 I'm running into a problem where a button with path content is only detecting mouse clicks on the path. I'd like to, for ux, to have the click registered anywhere in the button. I've set the background of the button to both null and transparent so the top control container dictates the background style. Here's another SO post : Mouse event on transparent background As stated I've tried both transparent and null so far. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml

How to hit detect on a null or transparent background?

丶灬走出姿态 提交于 2020-01-03 17:35:51
问题 I'm running into a problem where a button with path content is only detecting mouse clicks on the path. I'd like to, for ux, to have the click registered anywhere in the button. I've set the background of the button to both null and transparent so the top control container dictates the background style. Here's another SO post : Mouse event on transparent background As stated I've tried both transparent and null so far. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml

Silverlight Defaulting ContentPresenter Content

瘦欲@ 提交于 2020-01-03 14:15:18
问题 Why won't this work? In generic.xaml for a custom control: In the style applied to the custom control... <Setter Property="ChromeContent"> <Setter.Value> <Grid /> </Setter.Value> </Setter> ... Later, in the control template... <ContentPresenter Grid.Column="0" x:Name="ChromeContentPresenter" Content="{TemplateBinding ChromeContent}" /> Here's the dependency property for ChromeContent... public Object ChromeContent { get { return (Object)GetValue(ChromeContentProperty); } set { SetValue

WPF Custom Control: DependencyProperty of Collection type

♀尐吖头ヾ 提交于 2020-01-03 10:46:14
问题 I have a CustomControl which contains a ListBox : <UserControl x:Class="WpfApplication1.CustomList" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> <ListBox Name="listBox1" ItemsSource="{Binding ListSource}" /> </Grid> <

Sync Blinking Labels in C#

霸气de小男生 提交于 2020-01-03 08:45:07
问题 I created a BlinkingLabel class, derives from Forms.Label , which has a Forms.Timer which allows me to enable and disable the blinking effect. I have created 4 labels of BlinkingLabel type, my problem is that if all 4 labels where to blink in different times, the blinking effect is not synced. How can I adjust my design in a way that even if the labels where blinking in different times, the blinking will be synced? ******* Edited****** I added the following code, but still I can't get label 1

How to create and use custom control with UpdatePanel added to the page programmatically

不羁的心 提交于 2020-01-03 00:29:26
问题 I have simple web user control (the code I found somewhere in the web): <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="ARP.DynamicsCRM2011.MagicWebForm.WebUserControl1" %> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" Text="Checkbox" /> <asp:Button ID="Button1" runat="server" Text="Button" Visible="False" OnClick=

WPF Custom Control's ToolTip MultiBinding problem

五迷三道 提交于 2020-01-02 17:52:58
问题 When I set a ToolTip Binding In a WPF Custom Control, this way it works perfect: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... SetBinding(ToolTipProperty, new Binding { Source = this, Path = new PropertyPath("Property1"), StringFormat = "ValueOfProp1: {0}" }); } But when I try to use MultiBinding to have several properties in the ToolTip, it doesn't work: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... MultiBinding multiBinding = new MultiBinding();

WPF Custom Control's ToolTip MultiBinding problem

谁都会走 提交于 2020-01-02 17:51:32
问题 When I set a ToolTip Binding In a WPF Custom Control, this way it works perfect: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... SetBinding(ToolTipProperty, new Binding { Source = this, Path = new PropertyPath("Property1"), StringFormat = "ValueOfProp1: {0}" }); } But when I try to use MultiBinding to have several properties in the ToolTip, it doesn't work: public override void OnApplyTemplate() { base.OnApplyTemplate(); ... MultiBinding multiBinding = new MultiBinding();

set the font of a custom label added on a custom dialog page in nsis installer

时光毁灭记忆、已成空白 提交于 2020-01-02 17:48:49
问题 how to set the font of a label added on a custom added page in nsis installer To create the label i have used this : nsDialogs::Create 1018 var Label ${NSD_CreateLabel} 0 0 100% 32u "PLEASE CHOOSE WHAT DO YOU WANT TO INSTALL:" Pop $Label 回答1: !include nsDialogs.nsh var Label page custom pre function pre nsDialogs::Create 1018 ${NSD_CreateLabel} 0 0 100% 32u "PLEASE CHOOSE WHAT DO YOU WANT TO INSTALL:" Pop $Label CreateFont $0 "Arial" 18 SendMessage $Label ${WM_SETFONT} $0 1 nsDialogs::Show

BlackBerry - Invoke a click event on bitmap Field

跟風遠走 提交于 2020-01-02 16:19:07
问题 can anyone help me for solving the below question. I am making an application for blackberry in that from one bitmapField i have to invoke a new screen by clicking on the bitmapField. I want the code for the same... how to invoke a new screen by clicking on a bitmapField... and i am using blackberry JDE 4.7 回答1: Try making the BitmapField focusable BitmapField bm = new BitmapField(bitmap, BitmapField.FOCUSABLE); This might help 回答2: BitmapField bmpField = new BitmapField(bitmap, BitmapField