custom-controls

Programmatically create special Polymer-Element

泄露秘密 提交于 2020-02-02 07:14:05
问题 I have got a polymer-element with following html: <polymer-element name="tab-bar"> <template> <button>Hello</button> <template repeat="{{item in items}}"> <div>This element is {{ item }}</div> </template> </template> <script type="application/dart" src="tab_bar.dart"></script> </polymer-element> The underlying dart class looks as follows: import 'package:polymer/polymer.dart'; @CustomTag('tab-bar') class TabBar extends PolymerElement { List items; TabBar(List<String> items) { this.items =

WPF Custom Controls Are Invisible

谁说胖子不能爱 提交于 2020-02-02 02:47:26
问题 When I create a custom control in WPF and add it to a window, I don't see anything where I placed it in the dialog. Here's what I'm doing: Create a new WPF Application Add -> New Item... -> Custom Control (WPF): "CustomButton.cs" I change the CustomButton base class to Button instead of Control Add a CustomButton control to my main window. When I run the application or view the main window in the designer, I don't see anything. Here's what the code looks like. CustomButton.cs: public class

Drawing Rectangle around Custom TextBox control

本秂侑毒 提交于 2020-01-25 12:33:29
问题 I'm trying to create a custom TextBox control that will have two additional properties BorderColor and BorderSize. But the border doesn't shows up, even with BorderStyle set to None. Here is my code: Imports System.Windows.Forms Imports System.Drawing Imports System.ComponentModel Public Class BorderedTextBox Inherits TextBox Dim BColor As Color = Color.Black Dim BSize As Double = 1.0 Public Property BorderColor As Color Get Return BColor End Get Set(value As Color) BColor = value End Set End

Drawing Rectangle around Custom TextBox control

寵の児 提交于 2020-01-25 12:32:20
问题 I'm trying to create a custom TextBox control that will have two additional properties BorderColor and BorderSize. But the border doesn't shows up, even with BorderStyle set to None. Here is my code: Imports System.Windows.Forms Imports System.Drawing Imports System.ComponentModel Public Class BorderedTextBox Inherits TextBox Dim BColor As Color = Color.Black Dim BSize As Double = 1.0 Public Property BorderColor As Color Get Return BColor End Get Set(value As Color) BColor = value End Set End

Where is the resources.GetObject(“”) executing at?

做~自己de王妃 提交于 2020-01-23 11:23:27
问题 I have a custom control on a form. Basically my Visual Studio has been fubared for the past 5 hours because my properties are loading at initialization. The code: this.customControl.customProp = ((System.Collections.Generic.List<customType>)(resources.GetObject("customControl.customProp"))); What I would like to know is where this code is actually being executed at or is it storing these pieces of data somewhere? What is killing me right now is that there is actually data associated with this

Where is the resources.GetObject(“”) executing at?

梦想与她 提交于 2020-01-23 11:23:12
问题 I have a custom control on a form. Basically my Visual Studio has been fubared for the past 5 hours because my properties are loading at initialization. The code: this.customControl.customProp = ((System.Collections.Generic.List<customType>)(resources.GetObject("customControl.customProp"))); What I would like to know is where this code is actually being executed at or is it storing these pieces of data somewhere? What is killing me right now is that there is actually data associated with this

Set ClientRectangle in custom form in C#

天大地大妈咪最大 提交于 2020-01-23 02:52:26
问题 In C# I have custom form of None border style which override onPaint event and draw custom background with transparency key. I want to set my own client rectangle value (so content would be placed inside my custom border), but unfortunally Form's ClientRectangle property is read-only. I found advice over net to override WndProc method (where it sets client size) but saddly, I found very little info about that. Especially it requires to fill data which are pointed by lParam and wParam and I

WP8 how to create base-page & use it

吃可爱长大的小学妹 提交于 2020-01-21 08:23:19
问题 I've googled, but did not get any useful resources, so i decided to ask. Problem : I have a Windows Phone 8 C#/XAML .NET 4.5 Application , that is going to have several pages ( 15 - 50 ) that are all going to have similar look + same datacontext set to one instance of ViewModel : -------------------------- |logo usermenu(v)| -------------------------- | | | | | | | ..variable.. | | ..content... | | | | | -------------------------- Question : I can't find anything usable in this matter, could

How to achieve embedded custom tags in asp.net?

孤人 提交于 2020-01-17 07:30:50
问题 I found this example: <telerik:RadDatePicker ID="RadDatePicker1" runat="server"> <DateInput Width="100%"></DateInput> <Calendar CellAlign="Center" CellVAlign="Middle" DayNameFormat="FirstLetter" FirstDayOfWeek="Default" MonthLayout="Layout_7columns_x_6rows" Orientation="RenderInRows" TitleAlign="Center" UseColumnHeadersAsSelectors="False" ShowRowHeaders="False"> </Calendar> <DatePopupButton CssClass="radPopupImage_Default" BorderColor="#D0E1F2" BorderStyle="Solid" BorderWidth="1px" /> My

Making a Form as a reusable Control like FolderBrowser

末鹿安然 提交于 2020-01-17 05:36:07
问题 I have created a form that emulates a FolderBrowseDialog , but with some added features I wanted. It's tested and working, so now I want to make it into a control. My problem is that as soon as I inherit from UserControl instead of Form , I no longer have a Close() method, and I no longer have a FormClosing event. When I click on the OK or Cancel button, how do I close the form and return control to the calling object? 回答1: To make it a reusable component, instead of trying to derive it from