.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

How to drag UserControl during runtime

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Windows Application
I have a custom user control(name UIGrandChild) that is a child control of another user control(name Child, this control is a child control of the a form). I want to be able to drag the user control(UIGrandChild) into a panel in the parent form. Where should I put the dragenter and the other draging event handlers?

View Complete Post

More Related Resource Links

How to load a usercontrol xaml at runtime ???????

Hi, I have a usercontrol xaml created in Expression Blend. Similarly i have xaml for other usercontrols as well. Now i want to draw these controls at runtime on click of buttons, the way it works in VS IDE (Toolbox and Drawing area) Is there any way to load such usercontrols on Canvas at runtime ? What would be the best way to load controls at runtime ?      Programmer

usercontrol layout in canvas at runtime puts in mult. copies of 1st element in collection.

I created a usercontrol which has a few DP's that match up with fields in a sql table. The requirements of this control specify if I get a specific status value I will flash the usercontrol to draw attention to a specific area of equipment in the facility. I also provide a tooltip which has all the fields of data to view. The usercontrol should only display it's description. On a button click I run the following code which instantiates a new observablecollection of my custom usercontrol (I call it profiNode). It then fills a dataset by calling our DAL and then I loop through the datarows using the values to create a new profiNode object for each row. I then add these to the observable collection, but I suppose a generic list would work too.     ProfiNodes = new ObservableCollection< profi.profiNode > (); DataSet data = new DataSet(); data = this.DataLayer.getDataSet("Select * from ProfibusMapping", CommandType.Text, null); foreach (DataRow row in data.Tables[0].Rows) { profi.profiNode node = new profi.profiNode((string)row.ItemArray[0],(int)row.ItemArray[1], (int)row.ItemArray[2], (int)row.ItemArray[3], (string)row.ItemArray[4], (DateTime)row.ItemArray[5], (int)row.ItemArray[6], (int)row.ItemArray[7], (string) row.ItemArray[8], (double)row.ItemArray[9], (double)row.ItemArray[10]); node.ID = string.Format("node_M{0}_A{1}&q

Form Drag/Drop with a Usercontrol



I wanted to ask if it's possible to make it possible to drag and drop a Windows Form without a ControlBox in C#. So my Form has the Property "FormBorderStyle = FormBorderStyles.None".  I want to simulate a ControlBox by using an ElementHost and a costum WPF-Usercontrol. Could anyone help me with this problem?

Dynamically upload and use usercontrol at runtime


Hi All,

I was wondering if it is possible to upload the  .ascx and .ascx.vb of a custom usercontrol into my project directory at runtime via an upload control and then after that use through a database query point my page to load that newly uploaded control via (LoadControl(<newlyUploadedControl>)?

Please kindly advice and assist.

Thank you in advance.

Warmest Regards,


Create And Run Excel Macro At Runtime in C#

You've been tasked with writing a Windows Form application using the .NET Framework that interacts with Microsoft Excel. If you are new to working with Excel in .NET and are having trouble learning how to format certain cells or cell ranges, then this little tip will come in handy. Rather than scour the internet hoping to find the correct set of constants or method syntax for formatting your spreadsheet, use the built in tools in Excel to write the familiar VBA code for you. Then, you can paste the VBA code generated by Excel into the sample C# code below and run it dynamically at runtime.

How to Localize Windows Forms and Change the Language at Runtime

Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

Create new sql table at runtime VB.Net


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.

I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!

Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


Binding GridView with SqlDataSource at runtime?


Hi, I want to create a generic page which contains a gridview and sqldatasource. I want to put these two controls on .aspx (C#) page but bind them at runtime. It should have selectcommand, updatecommand, deletecommand and insertcommand. Stored procedures are created for that. Help is needed to make it. Please post some link or code. Regards, ap.

System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Excel cannot open or save any mo


Hello good people, 

I have this beast as an error. Did my research and found some posts here as well but did not do any good for me. 

Here is what I did. I had an error regarding issue rights with COM objects so I gave access rights under component services for Microsoft Excel application now I am getting this error. 

Here is some information regarding this

1. Gave rights to ASPNET and network service to my web app directory to try to fix this error. 

2. The exact same process works on my Windows 2003 server and my Windows 7 development machine. I am trying to get this going on a different windows 2003 machine that is outside of our domain.

3. Developing on windows 7 64 bit with office 2010 installed. Also excel 2010 is installed on my Web server

4. Here is the code that is causing the error: The last line is causing the error.:

            MyXl = new Microsoft.Office.Interop.Excel.Application();
            MyXl.Visible = false;
            MyWb = (Microsoft.Office.Interop.Excel._Workbook)(MyXl.Workbooks.Add(Missing.Value));
            int test = 0; 
            MySheet = (Microsoft.Office.Interop.Excel._Worksheet)MyXl.ActiveSheet;
            if (reader.HasRows)
                int InRow = 2; 
                for (int i = 0; i < Nu

Runtime development for All mobile device



   I am planning to implement a runtime or Environment . which allow any Mobile application to run on top of IT.

  Please give me couple of links or materials to help me out.

Thanks in advance.


Concurrent Affairs: Four Ways to Use the Concurrency Runtime in Your C++ Projects


This article describes how to integrate the new parallel computing libraries in the Visual Studio 2010 Beta into existing C++ projects. Based on four common scenarios, the column explains a few of the ways developers can use the APIs and classes that are part of the Parallel Pattern Library (PPL), Asynchronous Agents Library, and Concurrency Runtime.

Rick Molloy

MSDN Magazine October 2009

Wicked Code: Drag and Drop with ASP.NET AJAX


Jeff Prosise shows how you can implement drag-and-drop functionality in your Web app with ASP.NET AJAX.

Jeff Prosise

MSDN Magazine January 2008

CLR Inside Out: IronPython and the Dynamic Language Runtime


This column uses the .NET version of the Python programming languages IronPython to demonstrate the value of dynamic languages and the new Dynamic Language Runtime.

Bill Chiles

MSDN Magazine October 2007

Concurrent Affairs: Concurrency and Coordination Runtime


What can a robot-programming toolkit do for you? Read on and find out.

Jeffrey Richter

MSDN Magazine September 2006

Toolbox: Synchronize Data, Review Runtime Errors, and More


This month we bring you products that let you synchronize data, correct runtime errors, and more.

Scott Mitchell

MSDN Magazine August 2006

JIT and Run: Drill Into .NET Framework Internals to See How the CLR Creates Runtime Objects


There's lots to explore in the .NET Framework 2.0, and plenty of digging to be done. If you want to get your hands dirty and learn some of the internals that will carry you through the next few years, you've come to the right place. This article explores CLR internals, including object instance layout, method table layout, method dispatching, interface-based dispatching, and various data structures.

Hanu Kommalapati and Tom Christian

MSDN Magazine May 2005

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