custom-controls

How to make Custom contol look like other ToolStrip Items?

I have created a Custom Hosted Control using ToolStripControlHost and put it in a ToolStrip. Everything is working as expected. But my custom control does not look like other items in ToolStrip. How to make my custom control take the look and feel from ToolStripRenderer? or How to make it look like other items in ToolStrip? ...

Silverlight Custom TabItem?

Hi all, I tried to create a custom tabitem on Silverlight, but when i run it, it's complaining Unable to cast CustomTab to TabItem. I am not sure how to fix that, any idea? Thanks alot ...

How to know when my control changes size?

I'm building a custom control, and I need it to be able to respond when it gets resized. I need the old dimensions and the new dimensions available in order to do some calculations. Unfortunately, the SetWidth and SetHeight methods are private to TControl, not protected, and so I can't override them. Is there any other way to know tha...

Display: Custom Control

Hi folks, I've made a simple custom control: base.Style[HtmlTextWriterStyle.Position] = "absolute"; if (this.Expanded) // If the Calendar is expanded. this.Style[HtmlTextWriterStyle.Display] = "block"; else this.Style[HtmlTextWriterStyle.Display] = "none"; //create th...

Custom Image Button and Radio/Toggle Button from Common Base Class

Hi All, I would like to create a set of custom controls that are basically image buttons (it's a little more complex than that, but that's the underlying effect I'm going for) that I've seen a few different examples for. However, I would like to further extend that to also allow radio/toggle buttons. What I'd like to do is have a comm...

iPhone MPMoviePlayer Hide Controlls but Play and Timeline

Hi, I know about the MPMoviePlayerControlModes VolumeOnly, Hidden and Default. In some apps I've seen some players with rewind 30sec and just start/pause + timelime above. Was that a custom created view? If so how was it recreated including the fading controls on a touch especially how is that timeline recreated? I know how to impleme...

Adding a textblock to a custom wpf control (piepiece control from codeplex)

Hi Stackoverflow! I'm currently building a Surface application where the main navigation is a circular menu. For each menu item I'm using a custom control that I found on codeproject.com: http://www.codeproject.com/KB/WPF/PieChartDataBinding.aspx (PiePiece control) The number of submenu items (which is also piepiece controls) comes fr...

how to design a calendar control

I need to design a calendar control which should be added to our companie's application (I know there's already quite a lot calendar controls but I shall develop our own one...). How should I start, should I use a kind of table to display the days or should I completely draw my own grid? How can I do this (I do not need rdy-to-use code,...

Panel in Windows Forms Application not clearing

I'm working on my project: [Beer Pong Management System][1], a Windows Forms application. I am currently trying to add a whole tournament mode to it. In a nutshell, I've created a TabControl, with the first tab page with the settings and setup and the second page the brackets. There is a feature for each of the match-ups, that once ther...

Value is out of Range Exception While setting ResourceDictionary Source to CustomControl's generic.XAML

Hi, I have a custom Control which contains the generic.xaml inside the Themes folder. I have set the build action to Resource. Now from App.xaml I am setting the reference to the DLL by using : xmlns:localFolder="clr-namespace:customControl;assembly=customControl" After the reference is set I am trying to Merge the Resource diction...

Why won't my control accept keyboard input?

I've built a custom control that I'm trying to send input to. It will accept mouse input and report MouseDown, MouseMove and MouseUp correctly, but for whatever reason, it won't accept keyboard input. When I click on it, it doesn't receive focus, and any keys I press get interpreted by whatever control had the focus already. This is p...

Wrapped WPF Control

Hi, I'm trying to create a GUI (WPF) Library where each (custom) control basically wraps an internal (third party) control. Then, I'm manually exposing each property (not all of them, but almost). In XAML the resulting control is pretty straightforward: <my:CustomButton Content="ClickMe" /> And the code behind is quite simple as well...

CommandBinding broken in inner Custom Control when nesting two Custom Controls of the same type.

I've done a Custom Control in form of a GroupBox but with an extra header which purpose is to hold a button or a stackpanel with buttons at the other side. I've added the a Dependency Property to hold the extra header and I've connected the customized template. Everything works fine until I put one of these controls in another one. Now...

How can we do paging in datagridview in winform

I want to show 10 records per page in a datagridview on a window form and user must click next button to show next 10 records. Is it there some property in DataGridview or do i need to create a custom control. What i need to do to achieve this. ...

c# - clear surface when resizing

Hello, I'm trying to build my own custom control for a windows forms application in C#.Net. Currently I paint some rectangles and other graphic elements using the paint event. When I now resize the app form to fit the desktop size, all elements are repainted (which is exactly the behaviour I need) but the old one's are shown in the back...

Add 'Current' property to ASP.NET control

Hi! I have some control. I add one instance of this control to every Page in OnInit event and I want to access this control in other places in this way: Sample.Current public class Sample : Control { public static Sample Current { get { // ??? } } } Can you tell me what is the best way t...

User control or custom control for this design?

If I want to create a button control like that, is it supposed to be a User Control or a Custom Control? I am not sure maybe something else? Ideally I want to be able style/animate the main button and the inner button separately; also obviously Ill need to process their events separately. These buttons will be created at run-time and ...

Draggable tab control for Delphi?

Are there any tab controls available for Delphi where the tabs can be clicked and dragged to reorder them, like in a web browser? ...

2 or more Controls only 1 is considered Active

I have 2 controls (MyCtrl) next to each other called ctrlLeft and ctrlRight. Whenever one receives interaction it is considered active (by default the left one). I override OnDraw and customize the look of the active one a bit. Currently I have a property Active and an event that I subscribe to from all MyCtrl in there I store a refere...

Silverlight Custom Control in F# DefaultStyleKey

Wondering how to accomplish setting the Style xaml with the code in F#. The code is simple enough: this.DefaultStyleKey <- typeof<MyControl> In a C# project the build options allow you to mark the XAML as a resource custom build command of: MSBuild:Compile I don't see it in the properties panel, so I tried to add it by hand to the p...