usercontrols

Good resources for Winforms development

What are some good resources for winforms development? For example, when you have to have a bunch of different controls and event handlers on one form. Do you use partial classes, user controls, special attributes,...? How do you handle communication between user controls - only with events? Are there any patterns you can use? ...

SizeToContent on UserControl

In fact the UserControl lacks the property 'SizeToContent' that we have in Window. So the question is: what's the easiest and right way to simulate SizeToContent=WidthAndHeight behavior on UserControl? UPD... yeah I know it suppose to get that automatically if no Height and Width defined in the container where you're placing a user c...

How to determine current Page.Title value from UserControl

I have a MasterPage, several content pages - each of the content pages have a UserControl. In the MasterPage, I'm setting the Page.Title programmatically based on Page_Init "Request.UserAgent.Contains....", so that the content pages end up with different page titles based on this. Each content page has its Title set to blank (Title=" "...

accessing derived class from base class object problem

I have a kind of weird situation ... I have a User Control in WPF witch in turn has some other User Controls attached to it, then I have a huge C# code file with a big algorithm which needs access to the User Control UI Elements and methods, this hole process works with a Timer which sends data to the C# code file algorithm from the Use...

How to implement an image or pdf viewer?

Hello, for learning purposes I would like to know how to implement an image (and/or) pdf viewer on my own. I'm interested in the general approach to implement such a thing. I already read about the different formats on the net (tiff/pdf) so I found out that these files have a special format which describes where I have to look for a h...

Visualisation of derived classes in C#

I have a base class (representing a real world container filled with small spheres) and some derived classes. This works just fine. My problem is how to do their visualisation. I have a UserControl visualising the base class. Is the best solution to have a derived UserControl for each of the derived classes? Or is it better to have just ...

WPF + MVVM - Access object/property in UserControl

Hi! I have searched the net for a way to access an object/property within a UserControl. I have a Page object in my view in wich i load a usercontrol: <UserControl:RichTextEditorControl Height="350" /> How do i access an object/property which resides in the viewmodel of my view from my usercontrol? To put my problem in practice: i h...

Generalized settings UI + settings classes

For more classes derived from a base class I decided to have a base UserControl and derived ones for each derived class (for visualisation; box on the right side of the image). Now each of the derived UserControls have a specific settings (red rectangle on left) The settings UI is a separate UserControl (can be moved freely, put to...

UrlProperty and relative URLs

I have a custom UserControl (inherits System.Web.UI.UserControl) with this property, which should be set to a URL on the site that you want to link to: [DefaultValue("~/NewsItem.aspx"), UrlProperty("*.aspx")] public string InternalItemViewUrl { get { return _internalItemViewUrl; } set { _internalItemViewUrl = value; } } The co...

Save data for UserControl to ViewState

Hello. At my user-control I populate listbox with collection and want save data in viewstate\controlstate for further autopostback using. protected void btFind_Click(object sender, EventArgs e) { var accounts = new AccountWrapper[2]; accounts[0] = new AccountWrapper { Id = 1, Name = "1" }; accounts[1] = new AccountWrapper { ...

WPF UserControl Container C# VS 2010

I have a problem because y want to create a UserControl that can have a functionality as a container. I used the link: http://support.microsoft.com/kb/813450/en-us?fr=1 but i suposed that this part don't work for WPF 4.0: [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] public class ...

Loaded event of a WPF user control fire two times

Hi, To implement tab based environment in WPF we need to convert our WPF form to user control to accomplish tab based environment, however when doing this, loaded event of user control is called two times. While searching on the internet other people also pointed this issue. How can we ensure that loaded event is called only one time,...

Dynamically creating many instances of ASP.NET usercontrols: How do I create it, and where will my conflicts be?

I haven't seen this implemented before in ASP.NET, but am thinking about a UI that would look and act like this: Conceptual Overview A TabControl is loaded and the first tab contains a grid When a row is double-clicked, a new tab is created with the record detail The content of the tab/record detail is created by a usercontrol Many ta...

Dev resources for starting WPF Control Development

One of my upcoming projects needs a rather complex control (functionality wise) and I was wondering what, from experience, are good resources to look at / read? Any suggestions ...

What is the best way to establish communication between silverlight controls and ASP.NET

I thought I ask the more exprienced Silverlight users about what they think is the best way to embed Silverlight user controls into an ASP.NET page - in special regards to stablish an easy way of communication between the conrols. I have heard about services, query strings, etc. but I'd like to find out what has worked for you the best ...

load event not fired in inherited user control loaded from another assembly (Winforms)

Hi, I have an application with plugin-like structure. all application forms inherit from a base UserControl : public class BaseUserControl : UserControl { // some common properties and methods // protected override void OnLoad(EventArgs e) { base.OnLoad(e); } } and are compiled in different assemblies. When I want to show a form...

ASP.NET: Controls.Count always zero

Hi. I am trying to fire "Controls.Clear" but it never works because Controls.Count is always zero. This shouldn't be the case. I have pasted the program logic below. The comments are built by a control - Comments.ascx - which fires the below OnInit event: protected override void OnInit(EventArgs e) { _presenter = new Com...

Bind gui controls within a UserControl to another UserControl and its containing controls in WPF

Hello I have UserControl1 which is a FormatButtonBar with format buttons AND I have UserControl2 which is a DataGrid with RichTextBoxes as cell editors. I want to reuse UserControl1 at different places of my application. This is what I want to achieve with pseudo code: <UserControl1> <ToggleButton Content="bold" IsChecked="{Binding I...

usercontrol + __dopostback

I have a 27 usercontrols in a Ajax:Tabcontainer in a single aspx page with 1200 controls, I like to refresh any one of the usercontrol but unfortunatly it refreshed all the 27 user conrtrols... I have a huge performance hit on a web page. __doPostBack('UpdatePanelTobeRefreshed'); Thanks! Chetan. ...

If I use "FindControl" outside a UserControl, what do I use within a UserControl?

Suppose I have javascript within ASP.NET UserControl: function setValue(DataItem) { var selectedDate = DataItem.getMember('DomainNameKey').get_object(); Picker1.setSelectedDate(selectedDate); } Where Picker1 is also inside the control. Because Picker1's ID will be renamed at runtime, what do I put in the code below to make ...