custom-controls

custom button control WPF

Hi, i want to make a custom button using wpf. The button will be used to control a mediaplayer. the type(play, stop, pause,...) of the button is specified using an enum namespace vgtunesWPF { public class MediaButton : Button { [Browsable(true)] public Button_Type ButtonType { get { return (Button_Type)GetValue(Butto...

Event wont fire in custom control

hi, I am trying to create a simple custom control where in there is a image button on the control along with a label. the problem that i am facing is that the image button appears just fine along with the specified properties. But somehow when i click on the image button it does not generate the click event. the page simply refreshes. ...

Fixing the SubSonic 2.2 Calendar, How do I get RegisterClientScriptInclude calls to render when control is not visible?

Hello, I really liked the SubSonic 2.2 calendar control. It is a .Net implementation of the old Dynarch calendar found here. So I did what any developer would do and I swiped all the code for the calendar and put it in it's own library. Unfortunately the calendar does not play nice with an update panel. I got help here for getting the...

How to properly implement a custom control that handles mnemonics?

I am implementing a custom control in WinForms. This control needs to respond to a mnemonic character, and the mnemonic needs to focus the next control in the tab order - like a Label control does. The ProcessMnemonic method is clearly the one to override. However, looking at how the Label control does it, for reference, shows that it r...

Is anyone aware of a visual diagram that shows the composite parts of std. Windows controls?

For example: I would like to know exactly what system metrics to use to know how wide the borders of a window are going to be. With a given set of visual styles, what borders will appear, and how wide will they be (what system metrics can be queried to know exactly and correctly how wide they'll be)? Similarly, for a button, how wide a...

Style a button to match the current theme for the expand/collapse button on a TreeView

As you know, the built-in themes all define styles for the standard controls such as the TreeView control. We're trying to create something that looks an awful lot like a TreeView but isn't actually one, nor is it a subclass of one. It just has parts that we want to look like one for consistency. For instance, our control too has a se...

building floor plan in google map api

Hi, We have floor plans of a building in png format. I want to provide Google Map API( or any better Map solution) to the client to locate the buildings from a world map. The requirement is when the user clicks on a building, it has to load my floor plan of the building in the canvas. I was looking into overlays and mashups. Not able to ...

Tank level indicator question

Hello, I am playing around with C# and WPF. I am coming from the realm of microcontrollers and was wondering for the correct way to do things. My question is this, say for my horses I wanted to build an automated water dispenser as a school project for my kids using software. In the water control panel, the user would be able to see...

Handle ApplicationCommands in CustomControl

How do I wire ApplicationCommand.Undo to handlers in a custom control? Some code snippets would be most welcome... ...

Associating a marker (dot) with calendar control

Hi, My Application requires the calendar control and i had downloaded the custom calendar control from the below given link. http://blog.webscale.co.in/?p=244 Now the thing we want to do is put a dot in the tile for the dates which has some data associated with it. How can I implement it using the above calendar? Please Give Your Sug...

Control Library Issue: Failed to create a 'System.Type' from the text 'local:SolidGloss'

I'm working on a library of custom controls and I'm stuck on this error. Can anyone tell me what I'm missing? SolidGloss.cs: using System; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Anim...

Default Value for Dependency Property in Silverlight Custom Control

I've set up a custom control in SL and I'm trying to get the default look of the control to behave properly. I feel (with the help of some smart folks on here) that I am getting pretty close to getting this, but I'm still not quite there yet. When my control is first added to a panel in Blend, it shows up as I expect based on the templa...

Custom Control not displaying correctly

The Suraface SDK exmaples includes an exmaple which creates a ScatterViewItem which contains an Image and allows the user to annotate the image using a InkCanvas, it also contains two buttons which changes modes. <!-- Photo Pad - Transparent InkCanvas with transparent background overlaid on an image --> <s:ScatterViewItem Height="256"...

How can I handle arrow keys in a custom component in delphi?

I'm using delphi XE. I'm developing a component that is come from TPanel. TApGUITab=class(Tpanel) I handled key down event by handling WMKeyDown message, but it isn't called when I press arrow keys and it sets focus to another control instead of calling the event. What should I do now? ...

What is Custom Control and User Defined Control?

hi everyone,Can any explain me what is Custom Control and UserControl?The Main difference between them.Suggest me some basic examples links. Thanks in advance ...

How to add a custom button to windows' minimize/maximize/close (x)

Hi, I was wondering if there is a way to add (programatically, of course) an icon/button/whatever besides plain text to a window (Microsoft Windows window...)'s title bar or next to where the minimize/maximize/close buttons are. I could draw it myself and create an illusion it is a part of the window, but I wonder if in the user32 api t...

Can I create a WPF custom controll that has a "placeholder" item?

Hi all, We have a lot of controls that consist of: A container with rounded borders and a couple of buttons that call save & cancel commands on the view model somthing like this: <Border Background="White" CornerRadius="10" BorderBrush="Black" BorderThickness="1" Opacity="1" Padding="5,5,5,5" VerticalAlignment="Center" HorizontalA...

custom controls with sub components ownership

I have a Visual Studio designer enabled control which uses a collection editor to allow the user to create and edit sub components. For example, I have a control which offers a readonly "List" property containing a collection of bindings (themselves components with a name property and an event). The user can modify this list of binding...

Black WinForms button.

What is the most straightforward way to add a black button with white text in a WinForms Application? Simply setting the BackColor to black and the ForeColor to white the button border remains as before. Do I need to subclass the System.Windows.Forms.Button class and take control of the OnPaint() drawing? Thanks. ...

In a WPF custom control, is it possible for a child element to Template bind to the event of the control?

I have a custom control that contains two elements that can be clicked (a button and a check box). I'd like to be able to put events in the XAML for each of these events. i.e. <Control OnButtonClick="SomeEvent" OnCheckBoxClick="SomeOtherEvent" /> I have no idea how to bind events like that. Any pointers? The following is the ...