controls

Creating Custom Controls with .ascx files

Hi, I am looking creating some custom controls that need to be compiled as a stand alone dll rather than with the primary application. Unfortunately so far this has meant manually creating the controls without the use of the designer since afaik you can't compile a User Control as a stand alone component. As doing things this way make...

How do I identify which control generated the Click event?

In the following code, how do I identify which control raised the Click event? void x_Click(object sender, EventArgs e) { //How do I identify the sender? } private void fill() { for(blah) { Button x = new Button(); x.Click += new EventHandler(x_Click); this...

Why is my view state not storing a dynamic control adding using Controls.Add?

I'm trying to load a control depending on a category ID that is selected from a drop down list. This is this code i have within a switch statement to show a usercontrol. This was the only way i knew of doing it and having reusable views. I'm open to other methods as i've read a few people saying to avoid dynamic loading? var control = ...

asp.net mvc - constructing views completely off custom fields in DB

hi- i'm working on designing an asp.net mvc web app. There will be half a dozen (maybe more to come) different user groups of the app and they all work with similar but tweaked UIs, each with a few custom fields but all using the same objects. one idea for creating the UI is to store Control info with each field value in the database...

How do I dispose all of the controls in a panel or form at ONCE??? c#

is there a way to do this? ...

Silverlight 3 doesn't display a custom control's default template

Silverlight 3 doesn't display the default template for a custom control I'm working on. I have three projects in my solution: CustomControl.Controls - Silverlight Class Library CustomControl.Silverlight - Silverlight Application CustomControl.Silverlight.Web - Web Application In CustomControl.Controls I have the following class: [T...

Register User Interface Elements in Engine / Controller

Hello everybody! I am currently writing a little game with standard UI controls. It is working great so far but what I don't like is that I am managing the controls in the codebehind file. (C#) As I am trying to decouple all elements, I would like to have a separate engine / controller which handles all the data management and the log...

What are must-have third party XAML Controls

As I get myself ready to move my Winform applications to XAML, I was wondering what are the must-have third party XAML controls that will save me developing time and will make my app look shiny with little work? Thanks, Nestor ...

C#: Overriding OnPaint on ProgressBar not working?

Was thinking it should be pretty easy to create a ProgressBar that drew some text upon itself. However, I am not quite sure what is happening here... I added the following two overrides: protected override void OnPaintBackground(PaintEventArgs pevent) { base.OnPaintBackground(pevent); var flags = TextFormatFlags...

.NET - Proper way to get reference of a control on the form

I have a C# class library which uses a form (which is also in the library). Let's say I have an edit box on this form called editContents. In a regular form application, I'm used to being able to aquire the edit box like this: class MainForm { void Method() { this.editContents.Text = "Hi"; } } I guess some mag...

Any good .net membership user / group management controls?

I'm looking for any decent .Net membership components which can take the membership prodvider settings from the web.config and display the users / groups on an ASP .Net web page. I have a client requirement to be able to update / create / delete users as well as add / remove them from groups. There must be a decent control set out there...

Customizing the toggle state of a toggle button in wpf

I wanna customize the toggle state of the toggle button in wpf. I want to set a image to the toggle button when it is on and set another image when it is off. TO do so, i thought of using triggers. This is how i ended up doing, <Window ...> <Window.Resources> <Image x:Key="OnImage" Source="C:\ON.jpg" /> <Image x:Key...

iPhone UI controls for WinForms

Does anybody know where I could find WinForms controls that mimic those on the iPhone? I am interested in doing some iPhone prototyping using Visual Studio and it would be handy if I could make the controls look like the native iPhone controls. I know that I could just use Interface Builder on a Mac, but I do not want to do this. I just...

C# Add Icon To ToolStripMenuItem

I have a ToolStripMenuItem in my program. I also have an icon on my computer, for simplicities sake lets say its path is c:\myicon.ico How can i make the ToolStripMenuItem use this icon? ...

ASP.Net check if FileUpload control is empty

Hello, I am using LINQ to retrieve data from the DataBase, the variable name relative to link is "service". the upDocument is the Id of a FileUpload control. The objective is to delete the old file, before uploading a new one. This is the code i came up with: if ((service.image_url != null || service.image_url != "") && (upDocume...

How to find the dates shown in a Silverlight Calendar control?

Hi all, I have a Silverlight application that contains a calendar control. I'm wanting to 'black out' days for which we have no data available, using the BlackoutDates property. So I'm looking for a simple way to find all the dates that are currently visible (assuming a Month view, for now). I can use a brute force method, say taking...

Wire _KeyDown event of textbox to a _click event of button control

I have a form with a textbox called 'tbWO.' This field is used to enter a Purchase Order Number. I also have a button control called 'btnFill.' When btnFill is clicked, it fills a dataset with a parameter from 'tbWO.' I would like to be able to press 'ENTER' in the 'tbWO' textbox (after a Purchase Order # is entered) and have it fire...

Issues accessing an HTML table within a Repeater

Very simple scenario: I have a Repeater with a table spanning its Header, Item, and Footer Templates. Because it spans templates, I cannot simply do <table id="Blah" runat="server"> and then access it via FindControl. Is there any way to overcome this? EDIT: The goal is to be able to retrieve the HtmlTable then pass it into another met...

Posting source code to blog - Control with scrollbar & keep formatting

We are looking for a control we can use in our WordPress blogs that will keep our source code formatting and provide scrollbars. I know I have seen this control in use but cannot find a name or source for them. Thanks! ...

How can I get all controls from a Form Including controls in any container?

I need for example to disable all buttons in a form or validate all textbox's data... any Ideas.. thanks in advance!!! ...