usercontrols

C# How to draw in front of objects?

Hi How do you draw a string that is supposed to be on top of everything else? Right now in my panel i have some user controls in Panel1.Controls. So i added this to the Paint method: Graphics g = Panel1.CreateGraphics(); g.DrawString("BUSTED", new Font("Arial", 20f), new SolidBrush(Color.Black), new PointF(50, 50)); The problem is ...

How do I attach a UserControl to a form in an MVP pattern?

I'm trying to create a kind of master/detail UI using an MVP pattern. I have the usual suspects: interface IMainView{} class MainView: Form, IMainView{} interface IMainPresenter{} class MainPresenter{} // Numerous domain objects I also have a UserControl which is also a View of its own MVP triad: interface ISubView{} class SubView:...

Good Cross-browser tri-state checkbox?

Hey guys, I'm looking for a nice tri-state checkbox controller in JS ? Got anything to recommend me? The states I'm looking for are Checked Unchecked Indifferent (Was never checked/unchecked) ...

The same GroupName for few instances of a UserControl

I have a number of own UserControls on a page. Each has the same type and a radio button inside. How can I force only one RadioButton to be checked? I did next: class myControl : UserControl { [Category("Settings")] public string GroupName { set { radio.GroupName = value; } } } but it doesn't helped. O...

Problem with usercontrols in Umbraco

I have developed a usercontrol that I would like to embed in Umbraco. The process seems straightforward, but I may be trying something that can't be done. My usercontrol is dependent on several other usercontrols. When I try to Browse Properties in the "main" usercontrol I get the error below. I have copied all the .ascx files to the...

How to get width of button in DateTimePicker-Control/Controls in general?

Hello everybody, I implemented a custom DateTimePicker. On the DateTimePicker there is a button. In the examples I've found it's width is set to 16. This is working but I would like to have a dynamic approach. So, is there a way to get the size of this button or is there a general way to get information about .Net-Control sub elements ...

Binding to Command from outside a UserControl

Hello. I have a simple UserControl containing Label, ComboBox and Button. In brief, it is to be used throughout almost all of my Views many times, each time supplied with different ItemsSource and CreateItemCommand using Bindings to my ViewModel properties. The Label and ComboBox are part of another UserControl (LabeledComboBox) which ...

User controls as "screens" in a webpart

Hello! I'm workin on my first webpart. I use some number of user controls as screens. And I have a trouble here. First screen contains a list of dynamically created options (hyperlinks). After user made a decision with click, I want to change the screen and pass to the new screen some parameters. My dicision is to load all controls I...

Modify Page Head in User Control

How can I modify the head portion of a page from within an embeded user control? I know I can have the control run in the head portion of the .aspx page but I have a existing site with numerous pages that I don't want to change. One thing they all have in common is the menubar.ascx. So, I figured I could put the code there to modify t...

ListView (asp.net 3.5) read user choices

I fillin ascx control (in webpart) with a set of questions. Each question has 2 groups with 4 options to answer. I use a ListView control to display this set. var itemsToShow = from ... select new { MfKey = item[MVListsManager.MF_KEY], Order = item[MVListsMana...

Getting UserControl to draw under html div

I have a bunch of controls derived from System.Windows.Forms.UserControl, which are then being displayed in a browser (Internet Explorer only). The page they are in has a border (a div) that I want the controls to go 'under', but they all draw on top of it. I've seen pages claiming that what I need to do is make the UserControls 'windo...

Adding UserControls Dynamically and Finding

I am adding user controls dynamically to a page which all adhere to an interface. I want to be able to find these controls again upon Postback. I tried looking through the control collection but to no avail? Please help. Thanks. ...

User control added dynamically to a WinForm doesn't fire its inner controls events

I have a user control which has several radiobuttons and buttons... I have code to handle button's click events and radio button's CheckedChange event. After adding this userControl dynamically to a Form panel, I notice the events of the inner controls are not firing. I'm doing a "new" of the user control, and adding it to the Controls...

How to keep Font in inherited TextBox?

Hi SO-lers, I'm using the following code to get a TextBox that is not drawing its borders: public partial class CustomTextBox : TextBox { public CustomTextBox() { InitializeComponent(); SetStyle(ControlStyles.UserPaint, true); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); int borderWidth = 1; ...

How to make scrollbars appear in a resizable panel when the contained control is too big for it ?

I am developing a Windows Forms application (.NET 2.0, VS 2005). I have a form that essentially contains a panel that is dynamically resized with the form : this.panel1.Dock=DockStyle.Fill; This panel is simply used as a container. At runtime, a custom control will be added : UserControl uc=new UserControl(); panel1.Controls.Add(uc);...

How to invalidate() an ASP.NET UserControl?

Hello everyone, How to update the Control's preview in ASP.NET design mode? It is possible to re-draw the control by calling the ControlDesigner.Invalidate(). But How do I access the designer inside the Control? Thanks a million, dattebayo... ...

How to create WinForms components based on the type of an object

Lets say we have this interface: interface IVehicle { ... } And some classes implementing it: class Car : IVehicle { ... } class Boat : IVehicle { ... } class Plane : IVehicle { ... } In my user interface I have a FlowLayoutPanel and access to some sort of an IEnumerable<IVehicle> with a number of various IVehicle objects. Now I ...

How to set RequestValidate in UserControl??

I am getting error "A potentially dangerous Request.Form value was detected from the client" when trying to insert html content in DB from usercontrol. Two ways to get rid of this error are 1) Set RequestValidate = false for the page itself. 2) Set RequestValidate = false in web config. Both solutions doesn't fit in my case. It is Some...

Why would my child controls be uninitialized at the time of event attachment?

I have a page and a user control we'll call them Detail.aspx and Selector.ascx. Let's say the page shows the details of individual records in a database. The user control basically consists of a DropDownList control and some associated HTML. The DropDownList displays a list of other records to switch to at any time. When the DropDow...

ASP.NET renders incomplete HTML

I have an asp.net C# .net 3.5 page which contains several user controls. I am noticing that sometimes the html loaded on the browser is incomplete. It seems to get cut-off. Any suggestions on how to troubleshoot whats the root cause? ...