custom-controls

F# Silverlight 3.0 Custom Control Property throws: NullReferenceException

I have defined a Control with: static member ItemsProperty : DependencyProperty = DependencyProperty.Register( "Items", typeof<MyMenuItemCollection>, typeof<MyMenu>, null); member this.Items with get () : MyMenuItemCollection = this.GetValue(MyMenu.ItemsProperty) :?> My...

Winforms fixed single border on custom shaped control

Hi all, I have created a custom control inheriting from a panel in .NET 3.5 The panel has a custom polygon border, which comes from a pointF array (In diagram, control is highlighted yellow). Fig 1 shows the control with BorderStyle none. Fig 2 with BorderStyle fixed-single As shown in Fig 2, the border follows the Rectangle bounding...

C# custom control: Use internal content as Text field

I'm creating a custom control, and I want to get all the stuff within the tags and use it as a string Text field on my control: i.e. <custom:control ID="C" runat="server">This text should go into the text property</custom:control> Does anyone know how to achieve this? I've tried the following attributes on my text field (copied from ...

With what methods can I dynamically set an ASPX Control Property before it is initialized?

I need to configure a property of a custom control I wrote, specifically before the control calls OnInit. If I assign it as part of the ASPX file, it naturally works, but if I instead move the assignment to different parts of the code-behind, it will throw an error for having an empty and invalid value. The following is what it looks lik...

Advice Needed on Development of ConnectionWizard Custom Control

I have the need for an ASP.NET custom server control that will check the web.config file for a connectionstring name, prompt the user to create said connectionstring if not present, and execute create table stored procedures using the connection. This control will be embedded into a webpart for use in a WSS3.0 solution. Can anyone su...

C# custom control to get internal text as string

ok, I'm working on a custom control that can contain some javascript, and read this out of the page into a string field. This is a workaround for dynamic javascript inside an updatepanel. At the moment, I've got it working, but if I try to put a server tag inside the block: <custom:control ID="Custom" runat="server"> <%= ControlNa...

Block the display of cell on editing control

Hello, I have creating a custom datagridviewcell where i have implementing the editing control mode to show a custom control. this is my code : public class MonthCalendarCell : DataGridViewImageCell { public DateTime date { get; set; } public MonthPanelEvent panelEvent { get; set; } public MonthCalendarCell() : base() ...

how to draw nonscrollable elements on ScrollableControl

I have ScrollableControl inheritor and i want to draw elements (like header) which are not scrollable during scrolling. Is there any solution? ...

WPF Custom Control - Designer looks fine, but I get a runtime issue...

MainWindow.xaml <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my="clr-namespace:MyStuff;assembly=MyStuff" Title="MainWindow" Height="350" Width="525"> <Grid> <TabControl Margin="5"> ...

How to prevent a dll from being loaded in other apps

Hello, currently I develop a C#.Net application in which I'm using a custom control I developed some time ago. I need the dll to be shipped within the new application - but understandably I do not want the dll file to be used for foreign apps. That's why I need the custom dll to be somehow compiled within the new application. Currentl...

Automated Tests of Custom Controls

What options do I have to automate tests for the various aspects of my custom WPF controls, such as: Layout behavior input and user interaction behavior general apperance ...

Access to a Label on the Form by my Custom control

I have created a WindowsFormControlLibrary porject. It works fine, I can drop it on the forms,call its methods,etc ... but now as a property of it, I am passing the name of a Label to it. and I want this custom control to be able to use that label name and for example change its font to bold . so the question is that if I have a WinForm...

Modifying the Label Property(text and font) by a custom ComboBox

I have created a custom combobox that has a LABEL property so when we drop it on a form, we can say the Label associated with this ComboBox is say Label2 this is what I wrote for its label property. The whole thing I want to do is that when I am assigning the Label property of my custom ComboBox to one of the labels on the form, I want t...

WPF Custom Control containing a List of Objects

Hi, I have an object Trip in my object model containing a list of Nodes (e.g. NodeName, StartDate and EndDate) and I am trying to build a Custom control in WPF that draws list of rectangles: one for each Node contained in the Trip object (based on StartDate en EndDate) Would you have any hint on how the Custom Control should be structur...

WPF custom control problem

I have a problem, and I have not found the solution yet. I woud like to create a base custom control and use it in another custom control. The base control works fine when I use it in a window, but when I use it in the other custom control, the binding does not work. What's wrong with my code? Code: Model: public class ElementModel {...

Can't access resource from Generic.xaml within the Custom Control constructor.

I'm not sure why this is doing this, but I can't access the resource from within my constructor. XTabItem.cs using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace MyStuff { public class XTabItem : TabItem { public static readonly Dependency...

Silverlight: Binding a custom control to an arbitrary object

I am planning on writing a hierarchical organizational control, similar to an org chart. Several org chart implementations are out there, but not quite fit what I have in mind. Binding fields in a DataTemplate to a custom object does not seem to work. I started with a generic, custom control, i.e. public class NodeBodyBlock : ContentC...

Custom Control for Line

I want to design a custom Control for Line (vertical or horizontal line) basic usercontrol is rectangle and not suitable for line what s your idea about line control? ...

ASP.NET Web Custom Controls

Hello Experts, I am Beginner. I want to study and create custom controls. I have searched on Google but didn't find any good stuff. Could anybody provide me some nice link or explain me that how can I start custom controls. Thanks in advance. ...

ASP.Net container control with multiple control collections

I've been trying to create a special kind of fieldset. Which does all kind of fantastic things, but mainly collapse and maintain state. Also the two parts of the fieldset (in the legend, and in the rest) must be available to code behind (declaratively). The code in the consuming page or control should look something like this: <myTagPr...