custom-controls

Purchasing Pocket PC visual controls

Hello! In work we are considering buying a pocket pc controls pack, since we are not satisfied with the look of built in controls in visual studio 2008 (or better said latest Compact Framework). We are prepared to pay a reasonable amount for them, and we want the pack to be as complete as possible. It is important to us that the pack c...

c#: Rotating Text within a custom control

I am attempting to rotate some text within a label. I have a cusom label which allows me to have control over the text rendering process. protected override void OnPaint ( PaintEventArgs pe ) { Graphics g = pe.Graphics; g.RotateTransform( angle ); g.drawString( text ); g.ResetTransform(); } The problem I am having i...

Reference the default Style for a control in Silverlight

How do I reference the default style that appears in generic.xaml? I am trying to create a static class that returns known styles for a custom control. I know how to pull the styles that exist in App.xaml, but I'm not sure how to grab the generic one. public static class VehicleTypes { public static readonly Style SportsCar = /*??...

Hiding Popup control when other window's in focus

I have a custom UserControl which tries to recreate auto-complete for a textbox. When user types, the text is used to filter a provided collection of items and then a Popup displays a ListBox with items that match what user have typed. Unfortunately, if user decides to switch away from the application to another window (browser, MSWord,...

Creating a custom control...Cannot create a 'text' property?

Solution I did some googling and found this forum post, and here is what I needed to do: Imports System.ComponentModel <EditorBrowsable(EditorBrowsableState.Always), Browsable(True), Bindable(True), _ DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> _ Overrides Property Text() As String Get Return ...

UserControl as an interface, but visible in the Designer

So we have a C# WinForms project with a Form that contains a bazillion UserControls. Each UserControl naturally exposes all the UserControl methods, properties, etc. in addition to its own specific members. I've been thinking that one way to reduce the complexity of dealing with these UserControls is to access them through an interface...

Flag control properties as required in design view

I'd like to force the consumer of a control to give a property a value when placing the control on a page. In VisualStudio when you create an < img > tag without attributes SRC or ALT on a user control, it gets underlined saying that SRC and ALT are required attributes. I assume this is just a special handling of the tag by the editor,...

Adding column functionality to a Custom Repeater

Hi, I'm trying to extend a custom repeater I have in order to display in a tabular fashion (reasonably similar to a Gridview). What I'm conceptually looking to achieve is to get to something that can be applied in the following way: <my:customrepeater id="rpt" runat="server"> <cols> <col Header="ID">##ID##</col> <co...

Update all bindings in UserControl at once

I need to update all the bindings on my UserControl when its visibility changes to Visible. Pretty much all my bindings are bound to the DataContext property of the user control so I'm trying to update the target of that binding: BindingOperations.GetBindingExpressionBase(this, UserControl.DataContextProperty).UpdateTarget(); But I ge...

DataBinding fails for a collection property of custom control

I have a user control - say "ControlBase". It has "SomeItems" property, which is an ObservableCollection<InheritedFromDO>, where InheritedFromDO is a class inherited from "DependencyObject". When I create markup for a child class of the ControlBase i'd like to initiate the "SomeItems" collection. But somehow I cannot use bindings in that...

WPF Custom Draw Multiple Progress Bar

In processing a group of items, I wanted to display a unified image of the status of the group, so I essentially made a Grid of a number of progressbars with transparent backgrounds and various colored foregrounds all at the same cell. I'm running into some transparency artifacts (purple bar is actually purple under the green, and som...

WPF: What is the difference between a User Control Library and a Custom Control Library?

I am just coming up to speed on WPF and would like to create a reusable WPF control. When I look at the options for creating projects in Visual Studio, I see "WPF User Control Library" and "WPF Custom Control Library". It's unclear to me what the difference is between them and my Google searches have not turned up any decent explanat...

WPF: A TextBox that has an event that fires when the Enter Key is pressed

Instead of attaching a PreviewKeyUp event with each TextBox in my app and checking if the pressed key was an Enter key and then do an action, I decided to implement extended version of a TextBox that includes a DefaultAction event that fires when an Enter Key is pressed in a TextBox. What I did was basically create a new Class that ex...

Authoring custom controls in COM for Access 2003

Short version of question: How can I author custom controls for MS Access 2003 without resorting to VB6 ? Long Version: I have been spoiled with the pleasure of writing C# WinForms apps for the past 6 years and now I have to modify an Access 2003 application. Yes, it will eventually be rewritten as a Dot Net app, but for now, it mu...

string;# in dropdownlist

I made a custom dropdownfield. I want to display the full names of my contacts. I made a calculated column because not every user filled in their full name, only first and last. If I wanna show the items in my dropdown there is always string;# before my value. Does somebody know how to remove that? Here is the code where i fill my dropd...

Custom JSF component attribute list

I'm writting a custom JSF component that will render image transitions for a set of specified images. The list of images to be used by the component will be specified by the users of the component. The main component will do the rendering and the resulting markup is not html. I'm just learning JSF and I was wondering if there is an est...

Drawing a blinking caret in Winforms

I'm developing a custom control, which most resembles a text area. I am drawing text, which works correctly, and accepting input which also works.. But I (the user) am left guessing where the caret is while I type, since I'm doing everything manually. How do I draw a blinking caret to show where I am currently typing? Is there a standard...

how can I find out why a custom widget isn't showing up in the Qt Designer?

I created a custom widget by following the instructions provided in Qt Creator's help. I followed everything exactly as they said there. My widget isn't showing up with the other widgets. I even tried their WorldTimeClock example. That doesn't show in the Qt Designer either. How can I debug this? ...

RegisterClientScriptResource + AJAX update panel

Hello, I have a problem that is really making me feel dumb. I have a custom control that inherits textbox. This textbox (at least for this example) simply has a .js file that is embedded in the .dll. Long story short, works great when not in an AJAX update panel. So i did some research and found that instead of using: Page.ClientSc...

Adding files to project from Code while in design mode

Hi What I am trying to do is add resx files (or ant other file) to the project when I change a property on a form/control while in design time. I looked at orientation aware control from Clarius that does exactly this but I looked at their dll with reflector and can't seem to find out how to do this. Thanks ...