custom-controls

OwnerDrawVariable Combobox DropDown Blank Space

百般思念 提交于 2019-12-12 03:58:28
问题 I have developed the following custom combo box to increase the height of the items. Once that is done, a blank space appears at the end of the drop down menu when there is a scrollbar. How can I correct the issue? class MyComboBoxXX : ComboBox { public MyComboBoxXX():base() { this.DrawMode = DrawMode.OwnerDrawVariable; this.DropDownStyle = ComboBoxStyle.DropDownList; this.MaxDropDownItems = 5; this.IntegralHeight = false; } protected override void OnMeasureItem(MeasureItemEventArgs e) { e

Is loading the controls from template by traversing through the VisualTree a right way?

风格不统一 提交于 2019-12-12 03:36:58
问题 I have a custom control which has it's template defined and the template contains below code: <FlipView Grid.Row="3" Grid.ColumnSpan="2" x:Name="FlipView1" BorderBrush="Black" ItemsSource="{Binding ItemsCollection, RelativeSource={RelativeSource TemplatedParent}}"> <FlipView.ItemTemplate> <DataTemplate> <ScrollViewer> <Grid> <local:UserControlA x:Name="PART_UserControlA"/> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="100" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <local

UWP custom media controls not working

倖福魔咒の 提交于 2019-12-12 03:22:03
问题 below is the XAML code for my UWP app media element , but its not giving the customized media controls, why is that? <MediaElement x:Name="Media" Grid.Row="1" AutoPlay="True" AreTransportControlsEnabled="True" > <MediaElement.TransportControls> <MediaTransportControls Background="#FFF5F509" Foreground="#FF0625EA"/> </MediaElement.TransportControls> </MediaElement> 回答1: Although MediaTransportControls has Background and Foreground properties, but setting these properties won't affect the

Issue with custom control - Unknown property

谁说胖子不能爱 提交于 2019-12-12 02:47:48
问题 I have a custom control with one property, showDeleteButton. Type: boolean Editor: Boolean value Required field: true Sporadically I get this error message when building, in the XPages that use it: Unknown property showDeleteButton. It is not defined on tag xc:ccCommonActions I've tried deleting the custom control and recreating it. The issue still pops up after a few builds. I can work around the issue by disabling the required property, saving, enabling, saving, project->clean. Have anyone

Add child to custom Control in Designer mode

无人久伴 提交于 2019-12-12 02:44:45
问题 I have already seen this answer for adding designer support to a custom Control. It works up to and including adding child Controls. Except that after closing the designer and opening it again - those children are gone. Is there some way to get support for adding child Controls in the designer? Perhaps by some event that we can handle somehow "manually" (i.e. by my code)? This is not a UserControl . It's a class inheriting from Panel . 回答1: You need to shadow or override the Controls property

Find List of binded property in a Depedency Property in WPF C#

浪子不回头ぞ 提交于 2019-12-12 02:16:31
问题 I'm having a WPF Custom Control <local:SuperControl> <local:SuperControl.SBItem> <MultiBinding StringFormat="{}Name: {0} ({1})"> <Binding Path="Name" /> <Binding Path="ID" /> </MultiBinding> </local:SuperControl.SBItem> </local:SuperControl> The ViewModel Property public string Name { get; set; } public string ID { get; set; } Consider the Value for the Property Name = "John"; ID = "STK001"; The Custom Control public class SuperControl : ItemsControl { public static readonly

Apply CSS to single instance of Custom user Control in ASP:NET

微笑、不失礼 提交于 2019-12-12 01:47:25
问题 Ok I created simple user control that look like this <%@ Control Language="C#" AutoEventWireup="true" CodeFile="PlaceHolderCMS.ascx.cs" Inherits="Controls_PlaceHolderCMS" %> <div id="contentPlaceholder" runat="server" class="contentPlaceholderStyle"> </div> I am using it like this <div class="mainField" runat="server"> <cms:PlaceHolder ID="PlaceHolderCMS1" runat="server" class="PH1" /> <cms:PlaceHolder ID="PlaceHolderCMS2" runat="server" /> </div> But my problem is CSS, I can edit styles that

VS 2008, ASP.NET: Generate Local Resources

浪尽此生 提交于 2019-12-12 01:36:51
问题 I've build an simple control called Menu: namespace MyControls { public class MenuItem { public MenuItem() { Visible = true; } [Localizable(true)] public string Text { get; set; } [Localizable(false)] public string Link { get; set; } [DefaultValue(true)] public bool Visible { get; set; } } public class MenuDesigner : System.Web.UI.Design.ControlDesigner { ... } [ParseChildren(true, "Items")] [PersistChildren(false)] [Designer(typeof(MenuDesigner))] public class Menu : Control { ... public

Asp.net Gridview Rowdata is coming empty and Unchecked

≯℡__Kan透↙ 提交于 2019-12-12 00:27:51
问题 I have a requirement where i need to add column names and rowdatabound values dynamically .I has managed to get Column names dynamically .According to my need i want values to be displayed in the form of checkboxes in the rows of the grid either in checked form or unchecked based on condition but here every thing is coming in unchecked formate .. I am using .net membership Role table... Here is my code for gridview Dynamic column allocation.. protected void BindGridviewData() { var role =

Creating customs controls in Android

不打扰是莪最后的温柔 提交于 2019-12-11 23:29:10
问题 I want to create my own custom controls in Android application and use them in this way: In the XML file: <MyButton .... /> I would like to define MyButton some where in the resources XML 回答1: Create your own subclass of View (e.g., com.ofirbit.MyButton ) and then reference it in your layouts (e.g., <com.ofirbit.MyButton android:id="..." /> ). Here is an Android library project and demonstration sub-project showing an implementation of a custom ColorMixer widget and its use in an application.