custom-controls

WPF Change a property in a customcontrol after a button click

穿精又带淫゛_ 提交于 2019-12-13 04:07:37
问题 I posted a question in this link. maybe I'm not well expressed. It's very simple, I want to change a property in a usercontrol or CustomControl after a click on a Boutton outside... The code of the customcontrol is as follows : <Style TargetType="{x:Type local:CustomControl1}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:CustomControl1}"> <Border x:Name="container" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"

can't invoke paint

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 02:58:42
问题 I created my own control and overwritten the onpaint event, the problem is that the paint event stopped working Any ideas why? And how to restore it? 回答1: Let's have a telepathic guess here: You forgot to call base.OnPaint(...) inside your override. Meaning that the base functionality is no longer invoked. 回答2: Maybe the control is obscured. I had a similar problem, and the problem was that the form in the Designer view was bigger than the actual form when the application was run. My custom

Custom Event on Custom Control

六月ゝ 毕业季﹏ 提交于 2019-12-13 02:27:31
问题 I've got a custom control we'll call "TheGrid". In TheGrid's controls is another control we'll call "GridMenu". GridMenu has a button control in its own control collection. I'd like to enable the developer using this control to associate a page level method with the OnClick of that button deep down inside GridMenu ala: <customcontrols:TheGrid id="tehGridz" runat="server" onGridMenuButtonClick="mypagemethod" /> 回答1: On the GridMenu (which I assume is another custom control), expose the event

Developing custom kendo ui widget

江枫思渺然 提交于 2019-12-13 02:27:23
问题 How can I develop a custom widget behaving like this sample: http://jsfiddle.net/anilca/u2HF7/ Here is my kickstart reading, but I could not find out how to define the templates of dropdownlists and link them together by change events. (function($) { var kendo = window.kendo, ui = kendo.ui, Widget = ui.Widget; var Editable = Widget.extend({ init: function(element, options) { var that = this; Widget.fn.init.call(this, element, options); that._create(); }, options: { name: "Editable", value: "

Labeled TextBox in Windows Universal App

走远了吗. 提交于 2019-12-13 02:24:51
问题 I'm trying to realize a labeled TextBox in a windows universal app using C# and XAML , but I did not get the value of the TextBox in return, just empty string. The code of my generic.xaml for it looks like this: <Style TargetType="template:LabeledTextBox"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="template:LabeledTextBox"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TextBlock Text="

Custom control & opaque popup

落花浮王杯 提交于 2019-12-13 02:24:48
问题 I'm writing a JavaFX library containing a custom control. I've create a custom Skin for this control where I layout a TextField and a Button. When the button gets clicked a Popup windows should be opened. The trouble I'm having is that the Popup is transparent. How can I make it opaque? I tried to configure the background in the CSS but without success. The relevant code is inside the Skin implemenation of this custom control. The CSS is referenced by the getUserAgentStylesheet() method of

ASP.NET maintain control state that has collection items

╄→гoц情女王★ 提交于 2019-12-13 02:11:22
问题 Interesting. I have a control QuickContacts with Contacts collection. When I declare Contacts of type List<Contact> it works perfectly, but when use ContactsList<Contact> which is a Generic that implements IList<T> it gives "Parser Error : Type 'Controls.ContactList'1[[Controls.Contact, Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' does not have a public property named 'Contact'." Here, this code works perfectly with List<Contact> [DefaultProperty("Contacts"),

WPF custom shape control

删除回忆录丶 提交于 2019-12-13 01:54:23
问题 I was wondering if it is possible to make a custom shape custom control. I need to make control which contains textbox, however the control must have a shape of triangle or sth more sophisticated than regular rectangle/square. 回答1: Short answer is yes. Long answer is reading up on WPF Control Styles: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WpfApplication1.MainWindow" x:Name="Window" Title=

Getting started with a derived custom control?

﹥>﹥吖頭↗ 提交于 2019-12-13 01:16:07
问题 I am experimenting with derived custom controls, and I created what I thought would be the simplest possible derivation: I created a custom control project in VS 2010 and changed the base class for CustomControl1 from Control to Calendar . Then I went into Generic.xaml and removed the default Style created for CustomControl1. Finally I created a WPF app to consume the control. When I add the custom control to the app's MainWindow, I had expected to see a regular WPF calendar, since I had

How to create custom textbox in windows phone 7?

非 Y 不嫁゛ 提交于 2019-12-12 18:15:22
问题 Is it possible to handle the sip by creating the custom textbox. I want to create a custom textbox --> create the got focus event--> On focus of my custom textbox instead of SIP my custom keypad should open. Requirements: How to create custom textbox? Open the custom Keypad instead of SIP Get the cursor in the textfield. 回答1: The display of the SIP is handled by the operating system and will always be on top of the visual tree of any application. If you want to provide a custom SIP, you will