custom-controls

Custom button has missing text

I am trying to make a custom button, having two 9patch files, one for normal state and one for status. First I tried with a simple 9patch background and the result is fine: <Button android:id="@+id/btnTest" android:layout_height="80dip" android:layout_width="135dip" android:text="Test" android:drawabl...

ASP.NET: how to register control implemented in another assembly

I have own control implemented in "CommonControls" assembly (the same namespace). It us 'Custom control' inherited from 'WebControl' class and implemented without ascx file. It is necessary to use this control in "main" web site. Could you please advise how to register this control? I know it should be something like this: <%@ Registe...

type-bound custom ComboBox deriving from ComboBox

I am supposed to create a custom ComboBox by deriving a class from ComboBox in my WinForms application. I have never done this before and not able to find many good example from Google. I am required to derive a custom combobox so that I can make the custom combobox type-bound to a particular object. Could you please point me into ...

C# - Custom control with panel on it, how do I make the IDE add items to the panel?

I have a custom control which contains a panel, of which I want to be able to drop controls on in the VS IDE and have those controls actually be a child of the panel (which is a child of my custom control) and not have them added to the form my custom control is on. Basically what happens when you drop controls on a panel not contained...

Itemplate properties not available as attributes

I've added an ITemplate to Telerik's RadGrid control called SearchMenuTemplate ala: public class AbsRadGrid : RadGrid { private ITemplate _ItemTemplate; [PersistenceMode(PersistenceMode.InnerProperty)] [TemplateContainer(typeof(searchBar))] public ITemplate SearchMenuTemplate { get { return _ItemTemplate...

WPF rhombus shape custom control

Hi I have my custom control which looks like that <UserControl BorderBrush="#A9C2DE" HorizontalAlignment="Left" x:Class="Block" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="86" Width="151" ToolTip="{DynamicResource BasicTooltip}"> <UserControl.Reso...

Databinding to a custom control

Hey all, I have following situation in a C# Windows Forms (.NET 4.0) application: I have a bindingsource which datasource is set to a collection of objects of a custom class. Most properties of this class can be represented by a textbox or checkbox, as they are strings or numbers or bools. However, there is one property, called Rating...

how to create a custom control for a textbox

Hai Freinds So far i have used this coding to create a custom Control as my knowledge in the pervious post.i dono it is correct or not.I need a further help regarding this.so far i have used this coding the appcode->Number.cs in that i have used this coding further what should i do: my requriements is that i drag the textbox in the co...

Design time validation of custom ASP.NET server controls

I am creating a custom control which has some properties on it. The problem is that the control isn't valid without those properties being set and there aren't suitable default values for them. How can I make sure that they are being set in the ASP.NET markup when being included on the page? Is there some kind of validation event that c...

Any way to make this LINQ faster?

I have a LINQ expression that's slowing down my application. I'm drawing a control, but to do this, I need to know the max width of the text that will appear in my column. The way I'm doing that is this: return Items.Max(w => TextRenderer.MeasureText((w.RenatlUnit == null)? "" : w.RenatlUnit.UnitNumber, this.Font).Width) + 2; Howeve...

how do i handle events in c# wpf custom control

I have just started to explore custom controls in wpf. I am typically a vb.net developer. In vb.net there are a list of events in the code file in the upper right combo box. Even though the combo box is there, the events are not there in C#. I know how to override the events in c# but the signature is not the same and this is not the...

raisepostbackevent not firing

Hello everybody. I am building an ASP.NET custom server control. I have implemented both the IPostBackDataHandler and IPostBackEventHandler. OnPreRender I have registered the postback logic: protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (Page != null) { Page.Reg...

.NET 2010 custom control, multiline String property to be edited in the designer

I'm writing a custom control and I want to add a "MessageText" property of type String: <Browsable(True), DefaultValue(""), Category("CustomControls"), Description("Blah."), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> Public Property MessageText As String The MessageText property is a multiline ...

WPF numeric up down custom control

I've been needing to use a numeric up-down control for my WPF app. I read a similar question posted here and tried using the one available here > http://bot.codeplex.com/. I added the references and referenced it in my XAML window xmlns:lib="clr-namespace:PixelLab.Wpf;assembly=PixelLab.Wpf" and did this. <lib:NumericUpDown Name="yea...

How keep drop down opened in silverlights ComboBox?

Hi all. I use ComboBox control as popup. Item for my ComboBox is Grid. There is TreeView control and two Buttons in grid. Items of TreeView are CheckBoxes. When I click on Buttons or CheckBoxes drop down keeps opened, but when I click on other part of grid drop down i closed. Is there any way to keep it opened until I click outside of Co...

CreateChildControls issue with custom control

Hi, I have a custom control that creates a textbox on CreateChildControls. I'm trying to set the value of this textbox (trough a property of the control) on the load event of the page that uses the custom control. Unfortunately at this point CreateChildControls haven't been executed yet and the textbox is null. I called EnsureChildCont...

How to draw rounded raised and sunken edges of control?

I need a way to draw rounded raised and sunken corner edges on a custom control. Currently, I am using ControlPaint.DrawBorder3D, but of course the corners are squared off and looks terrible. How can this be done? Also, this project is not allowed to use any PInvoke calls. ...

User Controls VaryByParam?

Does VaryByParam also take into account the control properties and the logged in user? Let's say, I have a custom property: will VaryByParam cache based on unique values to that property? Update: I've added the <%@ OutputCache Duration="500" VaryByParam="*" %> to my user control. In the page the control is embedded in, I have this code...

.NET WinForms Custom Control: how to get a reference to the containing form

Is there a way, when creating a WinForms Custom Control/User Control, to get a reference at runtime to the form the control is placed on, so as to access various properties of that form? I would rather not pass a reference to the form into the constructor of the control, as, for various reasons, I need to keep a default constructor with ...

how can I render the bitmap property of a .net compact framework custom control in the visual studio form designer?

I have a custom control (inheriting from control; targetting .net compact framework v2) that has a bitmap property. currently an instance of the control on the form designer will only paint the selected background color and writes the namespace.control.name overtop. How can I have the image be rendered by the form designer after its ...