usercontrols

Submitting a form on a user control by pressing enter on a text field does not work

This seems to be a common problem but I cannot find a solution. I type in my username and password which are in a login control I have created. I then press enter once I've typed in my password and the page just refreshes. It triggers the page load event but not the button on click event. If I press the submit button then everything wo...

How do I grab events from sub-controls on a user-control in a WinForms App?

Is there any way for the main form to be able to intercept events firing on a subcontrol on a user control? I've got a custom user-control embedded in the main Form of my application. The control contains various subcontrols that manipulate data, which itself is displayed by other controls on the main form. What I'd like is if the mai...

How do I add Dispose functionality to a C# UserControl?

I have a class which implements UserControl. In .NET 2005, a Dispose method is automatically created in the MyClass.Designer.cs partial class file that looks like this: protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing...

Transfer Dependency Property value of a UserControl to a Control inside it

I have a UserControl (Composite control) that can be shown as the following pseudo XAML code: <UserControl> <DockPanel> <TextBox /> <Button /> </DockPanel> </UserControl> I use this custom control in a bunch of places and style some of them with a WPF Style. This style sets the Background property of the UserControl to a c...

Math Equation Web Control?

Is there any easy web application or user control that allows math equations to be easily created and stored as a text string? Update: An ASP.NET control would be ideal. ...

Losing Button.Click events after first partial postback in UpdatePanel

I have a Page that has a single instance of a UserControl that itself has a single UpdatePanel. Inside the UpdatePanel are several Button controls. The Click event for these controls are wired up in the code-behind, in the Init event of the UserControl. I get the Click event for the first button I push, every time, no problem. After ...

C# Google Earth Error

A friend of mine has embedded a google earth plugin into a C# user control. All works fine but when you close the window we recieve and "Unspecified Error" with the option to continue running the scripts or not. From our tracking it down it appears this is being cause by a script that google is dropping onto the page. Any ideas? ...

Inheriting from an ASP.NET web control: "Element <name> is not a known element"

I'm attempting to create a custom calendar control that inherits from ASP.Net's built in calendar user control. the code-behind file for my control looks like this: public partial class WeeklyEventsCalendar : Calendar { protected void Page_Load(object sender, EventArgs e) { } } and compiles fine. However, when I try t...

Silverlight ImageButton UserControl

I am just starting out with Silverlight (2 RC0) and can’t seem to get the following to work. I want to create a simple image button user control. My xaml for the user control is as follows: <Button> <Button.Template> <ControlTemplate> <Image Source="{TemplateBinding ImageSource}" Width="{Templat...

Embedding my .NET control in MS Project 2003

I need to extend MS Project's functionality for my company, so I would like to embed some .NET GUI controls into Project. The plan is that my controls save the user input into my custom DB tables, but I do have to bind them to tasks, current user, resources etc. Could you give me some advise how to start? I am interested in: Sample app...

UserControl that embedds another user control, how to access embedded form feilds?

Hi, I have a long form that the user has to fill out. So I broke the form into logical units and created another user control for some elements (they will be resued elsewhere). So say the form has these fields: UserControl3.ascx Username password email -- usercontrol2.ascx address -- usercontrol2.ascx city -- usercontrol2....

UI for easy, simultaneous adjustment of multiple controls

I am developing a specialty application where the end-user needs to operate multiple controls simultaneously. The application is used to "tune" the control parameters of an electronic device to calibrate the unit to its best performance. Currently, there is a UI with multiple graphical sliders which the operator click-drags one slider ...

Giving a custom UserControl an ID in rendered HTML

When I use a ASP:Calendar control, and give it an ID: <asp:Calendar runat="server" ID="MyCal" /> It looks like this in the rendered html: <table id="NameMangled_MyCal"... /> And I can access the element by ID in javascript like this: var cal= document.getElementById("<%= MyCal.ClientID%>") However, When I make a custom user control...

User Drawn Controls are using the previous Forms Background.

I have several user drawn controls on a form, unfortunately when the form is shown the user drawn controls are showing the previous forms background rather than the current forms background. The OnPaint event is very simple, and the OnBackgroundPaint event is empty... Like this: protected override void OnPaint(PaintEventArgs p...

How to avoid screen flickering when showing form with user drawn controls?

So the transparent background problem is solved. Now, every time I show the form (or have to have it repainted), I get a lot of flickering. Is there any way I can not update the screen until the paint event is complete, or any other way to stop the 1/2 second of flickering and flashing while all the objects are being painted? ANSWER: ...

Can I use the same editor for Control.Anchor property for my own user control's designer support?

I have a simple extender component that draws 3D borders around any Control. In my designer supprot for the component, I'd like to use the same editor that VS uses to select the Anchor property. I know I can use the [Editor()] attribute, but I don't know the class name of the editor that's used. ...

How to correctly inherit from a usercontrol defined in XAML in Silverlight

If I have a usercontrol (in Silverlight) that I've written, that uses XAML to define it's appearance, how can I make a customised version of it? i.e. I have MyControl.xaml & MyControl.xaml.cs What do I need to do if I want a "SpecialisedControl" child class? I assume I just make a new code file, then inherit from MyControl. But what if...

Casting a UserControl as a specific type of user control

Is there a way to cast a user control as a specific user control so I have access to it's public properties? Basicly I'm foreaching through a placeholder's controls collection and I'm trying to access the user control's public properties. foreach(UserControl uc in plhMediaBuys.Controls) { uc.PulblicPropertyIWant...

WPF throwing an exception parsing XAML that includes a Winforms User Control

I have a WPF app that makes use of a Winforms User Control that I have created using C++/CLI. When my app goes to parse the XAML for my main window, it throws an exception. The information appears to be somewhat abbreviated, but it says: A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in Presentation...

Interiting from asp:Image or asp:ImageButton?

I got this logic in a control to create a correct url for an image. My control basically needs to diplay an image, but the src is actually a complex string based on different parameters pointing at an image-server. So we decided to to create a control MyImage derived from asp:Image - it works like a charm. Now i need the same logic but ...