controls

composite control accessing javascript functions

I am creating a composite control, that implements IScriptControl. in CreateChildControls() function i have this: HtmlGenericControl ul = new HtmlGenericControl("ul"); HtmlGenericControl b2 = new HtmlGenericControl("li"); b2.Style["background-image"] = string.Format("url({0})", imageSrc); b2.Style["list-style"] = "none"; b...

get the control with a certain name provided as a string in c#

Hi there, i have the name of a control in a string and I want to manipulate the control, how do i turn the string into the current form instance of that control in c#? e.g. string controlName = "Button1"; What goes here? button1.text = "Changed"; Thanks ...

Applying a FontFamily to all Controls in Silverlight 4 Beta

I'd like to give every Control a certain FontFamily and FontWeight in Silverlight 4.0. I know that styles can now apply to all controls of a certain type, so I tried this: <Style TargetType="Control"> <Setter Property="FontFamily" Value="Arial" /> <Setter Property="FontWeight" Value="Bold" /> </Style> Unfortunately, that doesn...

How to access Form controls on Postback from Dynamically built form.

I'm adding controls at run-time to the Page Form object. Each control has an Id. On postback, I want to be able to access these controls and their values. Currently, when I do a postback, the form has no controls in the Form.Controls Collection. How can I rectify this? Is this only possible if you add the controls to the page every ...

CompositeControl and XML Deserialization on design-time error.

I get "Error rendering control" error that only happens when I place the control on the webform in desgin-mode, if I run the page the control is displayed correctly. The above statement is not important, this error happens because the returned toolbars object is null. After debugging, the problem is in a function that is called from Ce...

Using Java Controls/Properties during runtime???

I cant seem to get this statement to work during run time. textWords.setText(item); textWords is an object, setText is a method and item is an integer. Anyone familiar with this? I cannot seem to get this to work during runtime. There is no error, during runtime it just doesn't do anything! public class frmMain extends javax.swing...

in WinForms can control focus change "automatically"? if yes, can I somehow distinguish this from user triggered focus change?

I am not fully sure about this, but I seem to be observing cases where focus shifts automatically from one control to another, even after I explicitly programmatically set the focus to control that I want to have focused. Maybe it has to do with the control in question being a panel, and it seems that WinForms is happier to have a textbo...

How to enumerate MFC controls if I only have a h_wnd ?

Hello. Long time reader, first time poster. I'm a big noob when it comes to win32 gui apps so here's my question. Let's say you have a handle to a window: HWND h_wnd; That window ultimately has a bunch of controls, list, buttons and whatnot. Now I believe all controls inherit from CWnd (maybe that's not the right technical term i...

Microsoft Chart Controls best fit line

Anyone know any resources that will help me implement a best fit line in Microsoft Chart Controls. ...

C#: What is the proper way to swap winform controls?

What is the proper way to replace one winform element with another element when something is triggered? For example, I would like to replace a button with a text box in the same position and the same dimensions. ...

Sheridan SSDBGrid control having problems in a VB6 app

We've got an old VB6 application we wrote about 10 years ago. Back then we had no faith in data binding, so we did all of our own population of controls in code. (Long story, don't ask.) This application is one of our primary apps, so it gets used heavily. Back then, we purchased third party controls for various things, one of them b...

How do you instantiate .NET hosted controls dynamically loaded via JavaScript?

I am trying to load a bunch of .NET hosted controls into a page dynamically using JavaScript to inject OBJECT tags into the HTML. My problem is that the objects do not instantiate, only the static object that is visible on page load will appear. Is there any way to get these objects to load? <h1> Visible static</h1> <div id="st...

Control Properties in Visual Basic 6

Is there a way to ask for a control property in a loop?? I need somethig like this: For each p in control.properties if p = "Value" then msgbox "I Have Value Property" elseif p = "Caption" then msgbox "I Have Caption Property" end if next It could be done somehow? ...

Sending a Text Box control to the Printer?

I cannot seem to figure out how to send a text box control to print in Java. The Program creates word search puzzles, now I would like to print them. I simply want to print the text Box control as it is... But I had to try other methods as follows. My first problem is when I attempt to send it txtEasy.getText() it attempts to prin...

I want to make a panel have a thick border. Can I set this somehow?

I want to make a panel have a thick border. Can I set this somehow? PS, I am using C#. VS 2008. ...

Winforms control showing text and supporting individual line coloring

For a Winforms application, I'm looking for a control which is able to show text and supports individual line colors (fore and background colors per line). For instance, I'd like to have line 1 with a green background color and line 4 with red. ...

GridView vs DataList vs Repeater vs ListView

Hello all, I have read some articles about this matter... and it seems that the Repeater is the one with best performance as explained in this other question: I know that the GridView is the heaviest of them all, and that it weights a lot in the ViewState. So the DataList has been the "best" option for some situations. But how about D...

How to add filtering to the File Explorer opened by the asp:UploadFile control

Is there any way to open the file explorer setting the filtering options like a desktop application does?, and I don't want to validate the file after is selected, I want my users to view only valid files throught filtering them before. ...

Getting "Property value is not valid" message when Control is in Design Mode (VS 2008)

I am getting dialog box "Property value is not valid" when the Control is in Design Mode (Visual Studio 2008) and I try to change the Property's Value. Here is the property in question: <Description("Gets/Sets the visibillity of the SaveButton of Control")> _ Property ShowSaveButton() As Boolean Get Return _SaveVisible ...

Add a Load event for Winforms Control just as Form class

Hi, is there a way I can get a Load event for System.Windows.Forms.Control just like System.Windows.Forms.Form.Load? I want to run some initialize code before the control first shown. Also, it would be nice to be able to do the same for System.Windows.Forms.ToolStripStatusLabel which is not actually a Control, but works like one. Idea...