.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

.Net 4.0 Winform Control hosted in IE

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :Windows Application

We have an application that utilizes winform controls hosted in IE8+. In .Net 3.5 and before this worked great. We migrated our application to 4.0 and the exact same code will not function in IE. It compiles just fine and runs outside of IE. If I set our target framework back to 3.5 we have no problems. When we set it to 4.0 it just doesn't work.

I will say that we are gathering information from the system regarding printers.



View Complete Post

More Related Resource Links

Want to Create Table Dynamically With text Control in WinForm Csharp

Hello To All... from Many Days i m tryng to create a simple table using csharp in WinForm.Which will include textbox in each cell according the Passed No of Col & Row. but not getting the proper result. Actually i want to trace each cell data and want to save each cell data to data base : eg. in cell 11(1col & 1row) i m having Combobox which having some item list and when the user select the list item the data will save to the database. Regards, Praveen    What is the Key of Life ... Its Sharing Your Thought & Knowledge ...

Cross-Thread Exception at a WinForms control hosted by the WindowsFormsHost in WPF



I have a WPF Application and inside hosted existing WinForms controls.

In WPF i'm using the 'Dispatcher' with the 'CheckAccess' method to check if invoke is required, in my old WinForms controls i use 'InvokeRequired'.

The problem is, that if one of the WinForms controls gets created but not yet shown (drawn) and the application gets to the line, where it has to invoke, the InvokeRequired property returns 'false' even the code is not running under the Main Thread and so it resumes in a Cross-Thread exception.

The strange thing is, that it works fine, when the control gets visible (drawn) before changing it (in my case by switching to the specific tabpage).


For me it seems as if the 'InvokeRequired' property doesn't work reliable when the WinForms control gets hostet by WPF.


It would be great, if someone has experience with this issue and could help me!





how do you refere in xaml to a control hosted inside a userdefinedcontrol




I have my userdefinecontol


<Window1:MyUserControl    Margin="5,0,0,0"     MinWidth="10"
          Background="Transparent" >


I want to change some property of a control hosted inside the MyUserControl control 


how can I do this in xaml?

how to expose a dependecypeoperty of a control hosted inside anther one in a user defined control




I have a user defined control.

It inherit from grid and it has many controls in it and one of it is a textblock


I what to expose the dependecyproperty of the textbox how can I do this



I mean i want to do something like



dim MyControl as mycontrol

mycontrol.fontfamily    wher the fontfamily is actually   mycontrol.innertextblock.fontfamily



User can not run a winForm with the ReportView Control


hi there:

   I've developed a simple WinForm application and drag a ReviewViewer control to that form in order to pull a report from the report server. It runs perfect on my machine. However, after I compiled the apps and distributed to user's machine, she can not run it. Below is the error message


"Coudl not laod file or assembly 'Microsoft.ReportViewer.WinForms, Version =, Culture= Neural, PUblicKeyToken = bxxxxxxxx' or one of its dependencies. The system can not find the files specified.


 Any ideas?





--Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

A User Control which contains a WPF Control hosted in ElementHost can not SHIFT+TAB back (but can TA

For some reason, user controls which are built out of WPF hosted controls, seem to be unable to SHIRT+TAB back out of the control on the form.  One can TAB forward to the next user control without issue, however, unless you wish to cycle the form, there is no way to go back.  To see this in action, create the following single user control:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
    public partial class TextForFun : UserControl
        System.Windows.Controls.TextBox wpfTextBox1 = new System.Windows.Controls.TextBox();
        MyElementHost myhost = new MyElementHost();

        public TextForFun(int point)

            myhost.Location = new Point(0, 0);
            myhost.Size = new Size(50, 50);

how do I change BORDER COLOR for a TEXTBOX (and any other winform control) in a windforms app in VB

Does anyone have the VB code to change  border colors for winform controls such as a textbox?

Acessing controls in usercontrol in javascript function where user control hosted in webpart



1how to acess controls in usercontrol  in javascript function where user control hosted in webpart


2)How to retieve values from javscript code to server side

details as follows

StringBuilder controlString = new StringBuilder();
            controlString.Append("<p>" + CurrentPage.ToString() + "of " + TotalPages.ToString() + " </p>");
            for (int intIndex = 1; intIndex <= TotalPages; intIndex++)
                controlString.Append("<li><a hre

The property which can only be modified via propertyGrid Control.(Ref - WinForm,C# ,PropertyGrid)


Hi ,

        I want to have property in a class which is readonly when accessed via object referance and still able to modify when changed via PropertyGrid control.

         Is there any way to this? There is provision to create properties that are only modified at design time(Ex . AcessibleName property for  any control).But here the proopery is need to change behaviour at runtime only depending on wheither is it modified via direct object referance or by using a PropertyGrid Control.

The requirement is that I want this properyt to be able to modify only through user interface(like propertyGrid ) but at the same time no one should be able to modify this property at runtime.

.NET 3.5(2.0) winform control in MFC 7.1 application


Hi all,

I have a WinForm control in .NET 3.5 (can also be compiled with .NET 2.0), created in VS2008, now I'm tasked to embed this control in a legacy MFC 7.1 app (in VS2003). Requirement is to embed the control, not necessary to merge two projects.

Due to dependency on a licenced library, the MFC app can not be upgraded to new VS version.

I'm new to MFC and only have limited experience programming WinForm app. Is this possible at all? If yes, any sample I can follow?

Thanks in advance!

Best Regards,

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Using TemplateFields in the GridView Control

The GridView is composed of a set of fields that indicate what properties from the DataSource are to be included in the rendered output along with how the data will be displayed. The simplest field type is the BoundField, which displays a data value as text. Other field types display the data using alternate HTML elements. The CheckBoxField, for example, renders as a checkbox whose checked state depends on the value of a specified data field; the ImageField renders an image whose image source is based upon a specified data field. Hyperlinks and buttons whose state depends on an underlying data field value can be rendered using the HyperLinkField and ButtonField field types.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend