.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

drag scoral inside a form (LIKE photoshop HAND tool)

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :Windows Application

I have a form which is 1024*769 and the auto scroll property is on now I added a picture box with a picture (3000*3000)

now automatically the forms auto scroll will work okay ?

the code I am using to drag form here and ther is this:


int frmmouseDown;

private void Form1_MouseUp(object sender, MouseEventArgs e)
      frmmouseDown = 0;

    private void Form1_MouseMove(object sender, MouseEventArgs e)
      if (frmmouseDown == 0)

      if (e.Button == MouseButtons.Right)
        this.AutoScrollPosition = e.Location;  


    private void Form1_MouseDown(object sender, MouseEventArgs e)
      frmmouseDown = 1;

if the picture box is not visible then all works fine but when I enable the picture box I cant move or drag using the mouse I have to

View Complete Post

More Related Resource Links

form feild hints are not displaying for textboxses inside create user wizard?



I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";

User control or sub-form inside tab-pages? Best practice?

I've got a Windows Forms application with numerous tab-pages within a tab-control. Each tab-page is a diffirent user entry form with different controls of varying types. As the application is fairly large it is important that more than one developer can work on it simultaneously. Thus we decided to create a form for each tab so that different developers could work on different forms at the same time without overwriting each other's code. Each of these "sub-forms" are then assigned its relevant container tab-page as its parent. This works well but I was wondering if this is good practice or not, after another colleague commented that we are making forms look like user controls and that we should rather be creating a user control for each tab. I've converted two of the forms to user controls with relative ease and it does work nicely as well but with one draw back. On the main parent form, e.g. frmMain, where the tab control lives, there is one single button the clear the current display. When you click "Clear display" it clears various others items displayed on the main from, finds the current selected tab and clears its contents. The latter is easy to do with sub forms as I can simply close and dispose the sub form inside the selected tab, and load a new instance. I don't have to write custom logic to go and reset/clear each control on that form. Thi

save codes error in form view tool

hi i use this code in form view(at INSERT button)  for save data into SQL serverInsertCommand="INSERT INTO Debtor (AccNo, CompanyName, Desc2, RegisterNo, Address1, Address2, Address3, Address4, PostCode, AreaCode, Phone1, Phone2, Fax1, Fax2, NatureOfBusiness, WebURL, EmailAddress, DeliverAddr1, DeliverAddr2, DeliverAddr3, DeliverAddr4, DeliverPostcode, Attention, SalesAgent, DebtorType, DisplayTerm, CreditLimit, CurrencyCode, UDF_Shipvia, UDF_freigh, UDF_SourceIn, UDF_ProductEnq)VALUES ( @AccNo, @CompanyName, @Desc2, @RegisterNo, @Address1, @Address2, @Address3, @Address4, @PostCode, @AreaCode, @Phone1, @Phone2, @Fax1, @Fax2, @NatureOfBusiness, @WebURL, @EmailAddress, @DeliverAddr1, @DeliverAddr2, @DeliverAddr3, @DeliverAddr4, @DeliverPostcode, @Attention, @SalesAgent, @DebtorType, @DisplayTerm, @CreditLimit, @CurrencyCode, @UDF_Shipvia, @UDF_freigh, @UDF_SourceIn, @UDF_ProductEnq)"> it's show error at:-        Must declare the scalar variable "@AccNo".if i run the application without add (AccNo,....)VALUES(@AccNo) into above codes it's working good..AccNo is into drop down list control..

How to implement Design-Time drag & drop from Custom Visual Studio Tool Window to WPF Designer

Hi, Could someone tell me if it is possible to intercept a design time drop event coming from a custom Visual Studio tool window onto the cider design surface? I am hoping to use the same API's as those used by the Visual Studio 2010 'Data Sources' tool window, which provides drag & drop data-binding between classes and WPF/Silverlight controls. My requirement is to pass a DataObject (used with the WPF DragDrop API) from my custom Visual Studio WPF tool window treeview to my custom WPF control at design time, read the data and do some binding/XAML manipulation of my own. The drag aspect is simple enough but I can't work out how to accept a drop event from anything other than the toolbox. At the moment, when I drag my treenode over the design surface it shows the 'cannot drop here' cursor. If someone could give me some insight into how the 'Data Sources' tool window allows dragging of treenodes to controls I would really appreciate it. It is obviously possible but which API's are used and are they public? Thanks in advance, Paul  

Drag and drop images to form groups


My daughter is in kindergarten and the teacher asked me to help, I need to do a web page that will display images in one area, and allow them to be dragged to groups to categorize them, I guess I could add the needed number of panels for the groups but don't know about the dragging and dropping.  

Any help greatly appreciated,

Sr. Involved Parent. 

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?

how to set a value inside an Infopath form task control ?


Hi ,

how can I set a value inside an Infopath form task control ?

i used the following code but it's not working i don't know why

RequestSubmitted_TaskProperties.ExtendedProperties["TxtValue"] = "My Value";

so please advice



Unable to crawl the content form any of sites inside WebApplication


   I created two new web application, both the web application contain one site collection and inside contain site. In one of the web application search is working and another one Search is not working, am try to crawl the content from the website but it shows Zero item. But in other site collection it show the crawl item. Am in confused why it happed. Why am unable to crawl the content from the sites

How can I open an InfoPath Form in a modal Windows or Popup from inside another InfoPath Form


Hey guys, I need some help, please. How can I open, in a modal windows or pop up, an InfoPath form from inside another InfoPath form using a button or maybe a link. I need to be able to have both forms on the screen.

How can I do that? Can I use jQuery?

Help, please.

Thanks in advanced!

form inside authenticated page!




Inside authenticated page for only authenticated users can reach, i want to create a form and link it to a database, and the data will be saved in the database for this user only.


what is the code to accomplish thing?

also when i make a history page, i need the data to be showing for this user only that entered his info into the form.


should i use details view? or create text-boxes and link it to database for inserting?

Your preferred MS or 3rd-party SP Workflow & Form Tool


Hello, I just like to hear in a nutshell and from your experience your most favored '3rd-party or MS' SP Workflow & Form tool so far. My reason for asking is that I will be starting a long-term enterprise-wide project. For a start, I listed some of the them. Thanks in advance.

a. Nintex
b. K2 Black Point
c. Sharevis
d. Workflow Conductor

Reloading and refreshing flash files inside a windows form in wpf application


I have a app which shows load a flash movie in form, using this code

axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash()


The problem is that whenever I make a changes in the flash hosted in our application and try to refresh the to see the changes, the new changes is 'messed' up. to be more specific , it seems that the background and some controls of the previous flash still remain, 'spoiling' the new flash that is loaded. why?

Using the following methods before loading the second flash video makes no difference

axShockwaveFlash1.Refresh(); axShockwaveFlash1.Stop();

Even I tried  loading "empty" flash video before loading your new video?

axShockwaveFlash1.LoadMovie(0,""); but nothing worked

Its urgent.Could somebody h

Drag a file into windows form automatically i icon will be droped into winform with its shortcut fuc


Hi all

i have to make   a functionality in vb.net in which i just drag any file  from my desktop or from any location of system into my form on runtime and the icon will automatically drop to my application with its shortcut.

when i juct click that icon it will automatically open that file....

Just like the functionality done in bubble dock or star dock etc.


Kindly help me.

I am making a project on it for my final year examinations.


dynamically create a checkbox inside the infopath form?


I have a shared database that drives Windows Mobile Apps, Windows WPF Clients and now rich client InfoPath form (this wont be used an InfoPath web, only the rich office client)...

This database contains a list of daily changing of Audit Questions depending on the week and season etc.

I want to make a call to the database from InfoPath, pull back a list of LabelName and Controltype_id  1=checkbox 2 = textbox

In the Onload Event of the InfoPath form I want to dynamically create Textbox/Checkboxs with the label names from the database, with an question_id per answer.  Then the user will disconnect their internet and drive to the place without service (large metal multiroom coolstores without 3G service)  and fill in the checklist, the the user presses a button, and it evaluates all the answers and makes the background colour grey or black, and change the font colour to white. then the user presses the submit it back to the server when they are back in 3G service again.  

How can this be acheived? can someone send me some example code that works, thanks.

Please dont reply with "this is not possible", make the impossible possible.
1,000s of people told me I couldn't get barcodes into InfoPath even with the cursor on any form field. But I did it.
10,000s of people to

I want a shown form to stay inside a specified control


That is, say I have an ImageForm and something (Call it ImageHolderForm) that can hold multiple ImageForm windows; I want the ImageForms to stay in the ImageHolderForm window. How do I do that?


Infopath Browser Enabled Form - Filters dont work inside repeating table



I have been trying to create a Browser Enabled form to be used as a Sales Order form, the form will work in the following way.

It will pull in info from a sharepoint list with Customer Codes, it will pull in info from another sharepoint list with customer contact information which will be filtered based on which customer is selected.

There will then be a repeating table to place the order items.  The repeating table has 8 columns, 6 of which are lookups against 1 sharepoint list (all the columns are in the same list).

The sharepoint lsit data looks something similar to this:

Item Type                 Item Provider                    Product Relation              Product Description                Delivery Team              Cost
Service                     Us                &

storing infopath form inside a folder


hello all,

I have a browser enabled infopath 2007 form which i published as template to a form library..in the form library i have several folders and when i am going inside a folder and creating a new form and when submitting it then it is getting stored in the root and not inside the folder...can somebody help me out on this issue..


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