usercontrols

Distinguish between instances of user controls with mvvm-light.

I have two instances of a File Browser user control, the control is just a button and a text box, but I need two instances, think a diff utility. Once the user has selected a file for each control I want to enable a button which will perform an action on both of the files. The problem I am having is how to distinguish between the insta...

Overriding a Procedure in a Parent from a child control

I'm developing this usercontrol which requires I override the WndProc of the control's parent [which for all practical purposes is a Windows Form] and I'm stumped. Ordinarily, I could drop the user on the form and manually override the forms WndProc. Since my entire development team and possibly others I don't know of right now could be...

How can I create a usercontrol with properties set from Page when that property is a list in asp.net ?

I am building a usercontrol which can display data with many flags. I would like to be able to able to declare it this way, or something similar to that from the asp.net page <ctl:DisplayItem runat="server" id="ctlTest"> <flags> <flagIsAvailable /> <flagIsInError /> </flags> </ctl:DisplayItem> In my control, the flags woul...

UserControls in asp.net and Performance

Does UserControls in asp.net degrades performance. MasterPage has its own life cycle Page has its own life cycle and UserControls has its own life cycle. UserControls helps to divide work load and are easily maintainable, but does UserControls down grades performance of asp.net application? ...

WPF: Accessing a style of ResourceDictionary from inside of usercontrol

Normally, to set style using C#, I write, btn.Style = (Style)FindResource(_styleName); But what to do, if style is defined inside main 'ResourceDictionary', and button is inside some 'UserControl'. Also, I need to write script inside 'UserControl' only. To make it more clear - There is a button inside UserControl which should take sty...

GridView user control with paging in MVC

Hi friends, Is ther any user control for displaying data(like gridview in asp.net). Actually i found many control which works but, i cann't reuse it. Because in each and every page i need to put the same logic. Is there any control which I can re-use for all pages? How I create user control in MVC for GridView.?? ...

CollectionType Dependency Property

Hi Based on this tutorial: http://www.dotnetfunda.com/articles/article961-wpf-tutorial--dependency-property-.aspx I've created my usercontrol like this: usercontrol xaml: <UserControl x:Class="PLVS.Modules.Partner.Views.TestControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://sche...

Good way to ensure that a property on a UserControl gets set?

If our UserControl requires certain properties are set for it to be useful, what's the best way to ensure they are set? Even if just as a note to self and/or close colleagues. We've tried using an Initialize method, but that's already caught us out because we forgot to update the Initialize in one instance, having slightly changed the d...

Autosize datagridview in usercontrol

Hi i am developing a custom panel for outlook. and i have a question, how can i autosize width and height the datagridview to the userControl? This is what append: Edit: Microsoft.Office.Tools.CustomTaskPane taskPane; Microsoft.Office.Interop.Outlook.Application applicationObject; Outlook.Explorer explorer; Ta...

Setting property values declaritively for nested properties in web user control

Using ASP.NET 2.0 Say I have a user control that has a property which contains other properties. Is there a way to set these in a declarative fashion? For example, setting the MapOptions.Zoom property: <goog:RegionPicker runat="server" id="RegionPicker1" MapOptions.Zoom="15" ></goog:RegionPicker> I know I can expose it as a normal ...

TwoWay Binding with UserControl

I am trying to set twoway binding on a UserControl that I have created. When I use the control in Xaml is set the DataContext like so... <uc:MyUserControl DataContext="{Binding Path=MyObject, Mode=TwoWay}" /> My user control is defined as the following.... <UserControl x:Class="SilverlightApplication1.XText" xmlns="http://schema...

File Upload in MVC on an embedded user control .ascx file

Following the example here: http://www.highoncoding.com/Articles/689_Uploading_and_Displaying_Files_Using_ASP_NET_MVC_Framework.aspx I have an .ascx file I'm using as an editor template, and I would like to use this method to upload files, my .ascx file looks like so <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<M...

Is there a lot of overhead in a User Control?

I am working on a WinForms project which feels sluggish. It is composed of a literally hundreds of User Controls. If there is a piece of a UI functionality (even if not used anywhere else in the app), it's encapsulated in a User Control. I've gone through the project a number of times with the ANTS profiler and most of the heavy code a...

.Net MDIForm eating usercontrol keydown events

Hi Guys, I wonder if any one has experienced the following issue and can give me some pointers. We have an MID form with Cut, Copy, Paste, and Delete child menu items of a menuItem called Edit. Each of these child menu items has the ShortcutKeys property set with CTRL+X, CTRL+C, CTL+V, and Del, respectively. The short cut key and combi...

VS 2008 unable to find user controls in .NET Compact Framework application

When I open the form in the application, I am seeing an error for each user control in the project. Warning 13 The variable 'usercontrol1' is either undeclared or was never assigned. C:\Projects\MyApp\src\MyApp\FormMain.Designer.cs 202 0 and a matching Warning 6 Could not find type 'MyCompany.Controls.MyApp.us...

Is it possible to create basic event handler for many pages with user control or master page?

I need to create general actions menu for my pages. All of pages will implement some basical functionality, i.e adding new rows to some table, editing them, calling filters. Many of this pages will need only basical logic to run this functionality. But some of the pages will implement their own logic for options in menu. I want to make ...

How to lock the Height resizing in a .NET Custom Control while in design mode?

I'm developing a C# .NET Custom Control and I want to prevent the user, while in design mode, from resizing the Height, while allowing them to reize the Width. ...

WPF UserControl not rendering at design time

I am relatively new to WPF, so I apologize if I am missing something basic. I have a user control where I declare dependency properties named PT1x, PT1y, PT2x, PT2y: Private _pt1x as double = 9 Public Property PT1x As Double Get Return GetValue(PT1xProperty) End Get Private Set(ByVal value As ...

how to add an event to a UserControl in C#?

I have a UserControl which contains 3 labels. I want to make an event for it, which occurs when the text of one of the labels changed. I am using Visual Studio 2010 ...

user control with a textbox

Hi, I have a user control with a textbox in a win forms application. I would like to change the property of that textbox using the properties window of visual studio . I am using that control in various forms of same project ,is it possible? I have set the modifier property of text box as public and set following property in the user con...