controls

Best practices for control permissions?

Hey all, I need some advice on this... We have certain permissions setup in the database for certain levels of control a user can have over the application. Disabled, ReadOnly and Edit. My question is: Are there more generic/better ways to handle permissions applied to a form element on the page than writing a security method/check pe...

Design Modular Web Wizards using .Net 2.0 Wizard Control

We have a bunch of different applications that basically do the same thing written using the Wizard Control for .Net 2.0. At this point there are roughly 10 or so of those applications. The steps are pretty simple: User selects option from a drop downs -> Next page has more options more narrowed -> User sees confirmation page -> Rep...

Disabling all but one control in a WPF window

I have a bunch of controls on my window. One of them is a refresh button that performs a cumbersome task on a background thread. When the user clicks the refresh button, I put the cursor in a wait (hourglass) status and disable the whole window -- Me.IsEnabled = False. I'd like to support cancellation of the refresh action by letting ...

Ajax dropdown limit to list

pretty much what the title says. I am using an Ajax Drop Down as illustrated here: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/DropDown/DropDown.aspx using linkbuttons ... is there a way to limit to list? Thank you. Edit: I think it was VB 6 maybe that you could select "LimitToList" in a drop down. Meaning the user can only...

Add HTML control(s) via javascript

Something is eluding me ... it seems obvious, but I can't quite figure it out. I want to add/remove a couple of HTML controls to a page (plain old html) when a user changes value of a dropdown list. An example is to add or remove a "number of guests in this room" textbox for each (of a number) of rooms requested ... So if a user sele...

Finding all controls in an ASP.NET Panel?

I am having a number of panels in my page in which I am collecting user information and saving the page details. The page panel has textbox, dropdown list, listbox. When I need to come to this page. I need to show the Page if these controls have any values. How to do this? ...

Tag cloud control for WinForms .NET 2.0+

How would you render a tag cloud within a .NET 2.0+ WinForm application? One solution that I am thinking of would be using the WebBrowser control and generating to some ad-hoc HTML, but that seems to be a pretty heavy solution. Am I missing something more simple? ...

Implementing a WebControl factory in ASP.NET

Hi, I need to implement the classic Factory Method pattern in ASP.NET to create server controls dynamically. The only way I've found to create .ascx controls is to use the LoadControl method of the Page/UserControl classes. I find it messy however to link my factory with a page or to pass a page parameter to the factory. Does anybody ...

Order of controls in a form's Control property in C#

I am having a peculiar problem with the order in which FlowLayoutPanels are added in to the form's controls property. This is what I tried, I added 7 FlowLayoutPanels in to a C# window application from left to right in vertical strips. Then I tagged the flow layouts as 1, 2, 3, ... 7 again from left to right. Now in the load handler of ...

Class to automatically pull database fields into .NET Controls

I'm building a class that automatically loads a DB record, looks at each DB column name, and fills the associated textbox/label/literal/etc, if it has the same name. I got this idea from Rails, in case that helps clarify what I'm trying to do. public string presentData(Page thisForm) { // .. for each column name // ... thisForm.FindCon...

How to pass the current user to a web control declaratively

I'm creating a control and need to pass it the current logon user as a parameter (declaratively) I tried this but didn't work (I got "<%= User.Identity.Name %>" as value): <cc1:MyControl id="myid" runat="server" User="<%= User.Identity.Name %>" /> Is there a way to do it? ...

WS_VSCROLL, CreateWindow style works, SetWindowLong doesnt

When i do wnd = CreateWindow("EDIT", 0, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN, x, y, w, h, parentWnd, NULL, NULL, NULL); everything is fine, however if i remove the WS_VSCROLL and WS_HSCROLL then do the below, i do not get them thus have i...

Where can I find Visual Studio style tabs in either a built-in or 3rd party component?

I want to get Visual Studio style tabs (you know, the ones where you can tab through the currently opened files). Is there a 3rd party component that does this? How hard would it be to do myself? ...

C# Adding style to a control

I have a Panel and I am adding controls inside this panel. But there is a specific control that I would like to float. How would I go about doing that? pnlOverheadDetails is the panel name pnlOverheadDetails.Controls.Add(lnkCalcOverhead); The control named lnkCalcOverhead is the control I'd like to float. Thanks in advance EDIT: B...

Cannot tab out of databound Winforms dropdown list

This is a bit of a strange one, but I've been struggling for a few hours now and I can't understand what is happening. I was wondering if anyone else has experienced this problem, and can perhaps explain it. I'm building a simple Winforms app and trying to use many of the built in controls. Basically, I've got a form with a user contr...

VB6 How do I add a control at design time without using Drag 'n' Drop?

I'm attempting to create a Wizard type control in VB6 and have run into a stumbling block. I'd like to allow users of the control to be able to add and manage CWizardPage(s) to the design time control using a property page. The first approach I used was to add the Wizard pages to the OCX directly using a Collection, however I ran into ...

separate datatable for each row in db. .NEt

I have long tables generated by datagrid control that go beyond the page width. I would like to convert that into separate table for each row or definition list where each field name is followed by field value. How would I do that. ...

What is the best way to clear all controls on a form C#?

I do remember seeing someone ask something along these lines a while ago but I did a search and couldn't find anything. I'm trying to come up with the cleanest way to clear all the controls on a form back to there defaults. eg Clear textboxs, uncheck checkboxes. How would you go about this? ...

Is there a TDBComboBox equivalent that goes by ItemIndex?

In the helpfile entry for TDBComboBox, it says that the text of the selected option becomes the new value for the field. Is there any similar control that goes by ItemIndex instead of text? (To represent an enumerated type, for example.) ...

Textbox validation, focus switching issue

Good morning, I am working on a C# winform application that is using validation for the controls. The issue I'm having is that when a user clicks into a textbox and attempts to click out, the validation fires and re-focuses the control, basically the user cannot click out of the control to another control. My desired result is to have ...