usercontrols

Where to unsubscribe events in a WinForms UserControl

Where would you unsubscribe events in a UserControl? I subscribe to it in the Load event, like I have done in forms. And in forms I would usually unsubscribe in the Closing event, but I can't find anything similar in the UserControl... ...

Asp.net page - user control communication

I have a page Product.aspx,there I have a user control ProductDisplay.ascx which has been created by drag and drop. Now when a button is clicked in ProductDisplay.ascx,I want a logging function to be called which is in Product.aspx. To achieve this I have used delegates on ProductDisplay.ascx public delegate void LogUserActivity(Prod...

Asp.net User Control with underlying control editor functionality

ASP.Net 3.5 I want to create a user control that contains the ListView and DataPager controls along with some custom code in the ItemDataBound that is generic and deals with UI styling. Ideally, when the developer uses this control, I would like to retain editor support so they can select a datasource, add/remove columns, etc... Is ...

IsClientScriptIncludeRegistered question

In The Page_Load event of an ASP.NET USercontrol, I have the following Code: If Not Page.ClientScript.IsClientScriptIncludeRegistered("ProperCase") Then 'doesnt seem to work but no apparent harm. Page.ClientScript.RegisterClientScriptBlock(GetType(String), "ProperCase", GetJavaProperCase()) End If And here's a function...

derived usercontrol in c# overwrites the html from its parent is it possible to not do this?

Hi, i am working on a project, with a set of usercontrols beeing loaded dynamically think about sort of a portal page with a bunch of widgets (blocks) and all of them are a usercontrol. they have certain things in common, so i made them all derive from a masterBlock usercontrol now is there a way to also have some output (in the .ascx...

How to develop a file uploader control similar to the one in live skydrive using C#

I like the drag & drop feature of the skydrive file upload control. How do i go about developing a similar control? ...

ASP.net Formview Usercontrols "deep save" - why am I not getting replies?

Hi, it seems my question http://stackoverflow.com/questions/1361261/asp-net-2-0-user-control-in-a-formview-needs-to-save-user-data-for-dummies is unlikely to get replies - I wonder why: did I miss someting? Is it too easy & obvious for you guys? Or too tough? (No, it can't be - I'd bet) Would you need more details? Sure, I didn't post a...

ASP.NET MVC dynamically load user control, like in ASP.NET Web Forms

Hallo, my team and I are about to start a project, and we would really like to use ASP.NET MVC, not the Web Forms. Why? Nothing special, just we want to learn it well and to measure what would be better to use in future projects. But, our project has important request. We need ability to dynamically load user controls, that can be creat...

InkPicture control on scrollable control 'jumps' when clicked?

I tagged this with C# because that's what I'm working with. Might be true in VB, too. Doesn't really matter for me wiht this project, though. Apologies in advance for the wordy-ness. If any one would prefer, I have a small project I mocked up to isolate this very weird behavior. To observe: 1) Create a simple windows form project 2) ...

Referencing DataItem of parent Repeater control inside a User Control

I need to place a user control into the template of a repeater control and reference data items from the repeater's datasource. I tried (ignore the second cast which is specific to the CMS platform I'm using): <%# ((EPiServer.Core.PageData)((RepeaterItem)Container.Parent.NamingContainer).DataItem)["PageName"]%> But that throws back t...

Shadowed property in ASP.NET UserControl does not gets serialized

Hi All, I have a one more question on ASP.NET UserControl. Assume I have a user control MyUserControl that exposes BufferCapacity property. The control internally maintains an array of size BufferCapacity. Now at design time I have shadowed this property. But if I change the proeprty, the value is not getting serialized in the *.aspx co...

Design-time editor support for controls collection

I'd like to add a property which represents a collection of controls to a component and have a collection editor with which I can easily select the controls that belong to the collection. VS does almost what I want automatically with the following code: Private _controls As New List(Of Control) <DesignerSerializationVisibility(D...

What are the purpose of User Controls in Visual C#?

Good afternoon all. User Controls -- Do they serve a special purpose? As far as I can tell they are no different to forms - they have the same toolbox and features. Are there certain times when they are appropriate to use over forms? It would be interesting to understand what they are good for. Regards ...

How do you wrap text around a user control?

I need to wrap text around a user control. Specifically, I am displaying an image in a user control. Normally, the align="right" would handle this on an image byu itself. But, put inside a user control, it doesn't seem to flow. I already tried putting the control in a div but this didn't look right either. ...

How can I bind to a sub-property of a specific item in a List<T>?

How can I create a binding to a sub-property of a specific element in a list? I've created a class that exposes an IList property: public IList<VideoChannel> VideoChannels { get { const int NumVideoChannels = 4; return (new List<VideoChannel>(NumVideoChannels) { new VideoChannel("Ch...

VB6, Usercontrol: Remove ability of getting focus

hello while designing my user control, i encountered the following problem: i would like to set the UserControl.CanGetFocus to false, which is not possible due an error message telling me that a control unable to receive focus can not contain elements who are able to receive focus. but as i don't want them to actually receive any focu...

Listbox ClearSelected method leaves items selected

Hello, I have several winforms listbox controls I am hosting in a user control. The behavior I want in this user control is that I only want ONE of the listboxes to have a selected item at a time. So if I have an item in Listbox1 selected and I click an item in listbox2 listbox one should be automatically have all items deselected. ...

WPF UserControl TreeView Height

I have a user control which contains a StackPanel and TreeView. All controls have the Height="Auto" When I use the Cusotm control on a window and set Height, say Height=800 The STack Panel grows to this height, But the TreeView does not auto heigh adjust. UserControl: <UserControl x:Class="WPFDataBinding.ucCompanyTreeView" xmlns="h...

c# - perfect syntax highlighting

Hello, I'm looking for a RichTextBox with syntax highlighting! Sounds easy but I'm searching since months and didn't find that what I need. First I started to do it by myself... No good idea... I tried to use this: http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx but that code don't hand...

Web User Control

Hello I am written a User Control. in the User Control, There are Header and Footer. i want insert gridview or any Control , in Content of the User control. for a Example: <Menu:Menu id="1" runAt="Server"> <Asp:GridView ...> /// or any control </Menu> Thanks ...