.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

Changing the cursor Position

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :ASP.Net

Hello all,
On Image Click how to move the mousecursor position in web application???

In case of windows application on button_click i have written the following code:

Point p = new Point();
p.X = 41;
p.Y = 400;
Cursor.Position = p;

This works fine & cursors position also change.

but how to do that on aspx page or in web application?????

In my case on Image click i have to move the cursors position.

But I have to move the cursor with clienside script i.e Java Script . How to do that????
Any help
will be appreciated.

Thanks in advance,

Chandrakant Tale.

View Complete Post

More Related Resource Links

Changing Mouse Cursor into Crossed Circle in ListBox-ScrollBar/ScrollViewer(on Drag and Drop).

Hi All,   I have a ListBox with 10 items, the automatic Scrollbar/ScrollViewer is appearing. If i'm dragging an item from the listbox and moving the mouse cursor on top scrollbar/scrollviewer the cusor have to change into CROSSED CIRCLE(means its not a location to drop). Can any one help to do the same, or please let me know if more info needed.   Thanks, Karthikeyan Manickam.

Cursor Position not working on Form_Load

This is the only line of code in my Form_Load event and the cursor does not move to the submit button.I've tried to point it at other controls on the form and I get the same result...the cursor moves but to an area on the form (somewhat bottom left) where no control exits. System.Windows.Forms.   Cursor.Position = new Point(btnSubmit.Location.X, btnSubmit.Location.Y);Paul Reed

Move cursor position during drag drop operation



I know how to change to a custom cusor or visual instead of a standard cursor during drag and drop operations.  I know how to get the current mouse position during drag and drop methods (often there is a GetPosition method, or alternatively I can use p/invoke or System.Windows.Forms.Cursor.MousePosition getter).

My question is, how can I (or is it not possible) to change the mouse position programmatically during the drag/drop operation, ideally just before the drop occurs so that items are dropped at the point of the programmatically set cursor position? 

I tried to to use the System.Windows.Forms.Position setter and SetCursorPos both in the source's PreviewQueryContinueDrag handler and the target's PreviewDrop handler but neither affected the position of where the items were dropped.  In the case of PreviewQueryContinueDrag, the mouse visually moved to the programmatic location after the items were dropped, even though the PreviewQueryContinueDrag handler was called before the item was dropped (and before PreviewDrop).

Any ideas?



Move cursor position during drag drop operation



I'm enhancing the behaviour of out of the box WF designer drag/drop experience.  One of the things I'm trying to do (in part) is when a toolbox item is drag over an existing activity designer and then dropped, I want the toolbox item's activity to be dropped close to the activity designer on which it was to be dropped, but not directly on top of the designer.

To accomplish this, I detect when a drop operation is about to occur and then I attempt to move the cursor position next to the activity designer.  The problem I'm having is moving the cursor during the drop operation.  I've tried various ways to do this programmatically, but nothing seems to work.  Or, perhaps it is getting moved but then the workflow designer (and in particular the flowchart designer) does something special with mouse position or otherwise ignores it. 

I started out posting this question on the WPF forum, but now I'm beginning to wonder if perhaps there is something unique to  the WF/flowchart designer that's causing the mouse not to move (or to move back to the original position perhaps) rather than a general issue with moving the mouse during drag/drop operations.

Can anyone provide any guidance?



HTMLEditor: Add text to the current cursor position



i am currently using the HTMLEditor and i would like to add a text to the current cursor position in the Editor.

The reason is, i want to add replacement tags when selecting an item from a dropdownlist.


Is that possible at all with the editor component?


I am appreated for any help.


Changing the cursor postion.


Dear all,

I m using a div to show menus on master page .

Div contains the html table whcih has  2 rows showing the main(Parent) menus(Master,Reports).

Each row contains html table with  4 or more rows(tr) which shows their respective sub-menu.

Onmousehover of image I m showing the div.

Onmouseleave of div I m hiding the div i.e when user leaves the div ,div gets hide.

Master menu is at top,below it is Report menu in div.

When i click on Master Menu their submenu get opens which has 10 submenues .

But when i click on Report Menu(Report menu has 4 sub menus) Their submenues are opened & Master Menu if already opened should be closed.

As soon as I click the Report menu it opens its submenu and closes the submenu of master.

The problem is that the div size gets mimimizes(which is correct) and cursor remain out of the div .

and calls the Onmouseleave function for hiding the div

Therefore user cannot see the report submenu.

how should I stop this from happening?

I got one solution i.e To keep the cusror along with its main(Parent) menus  ,so how to acheive that


Can any one help me how to move the cursor position in webpage.


Chandrakant <

changing the control position


How can i change control position in aspx page at runtime Is it possible through xml / xslt  files
with out re-depoying the code.Any sample code / links
Please help me out 

is there any way to know the position of my cursor - in TextBox control ?


i have in my C# (WinForms) program TextBox control

if i have this text in: `abcd efg hijklmnop`

and i stand with my cursor between `c` and `d`  = position 3

or i stand with my cursor between `h` and `i`  = position 10

how to get this position ?

thank's in advance

Set cursor position in TextBox


Im writing Custom control in asp.net

after AutoPostBack , one Textbox of Custom Control always is focused, but cursor position always is in the first position of TextBox

anything idea that make it at the right of the string in Textbox ?

Thanks a lot !

Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Cursor Functions

A cursor allows looping through a record set and performing a certain operation on each record within the set. SQL Server supports three functions that can help you while working with cursors: @@FETCH_STATUS, @@CURSOR_ROWS and CURSOR_STATUS. Cursor functions are non-deterministic.


Defines the attributes of a Transact-SQL server cursor, such as its scrolling behavior and the query used to build the result set on which the cursor operates. DECLARE CURSOR accepts both a syntax based on the ISO standard and a syntax using a set of Transact-SQL extensions.

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

How to position one control relative to another one even after resizing windows?


I used following Jquery code trying to make image close to a table. It worked fine after first load, but the position changed after window is resized. Any ideas? thanks

$(document).ready(function() {
            var pos = $("#mytable").offset();
            var width = $("#mytable").width();
            var left = pos.left + width + 20;
            var top = pos.top + 200;
                position: 'absolute',
                zIndex: 5000,
                left: left,
                top: top

Problem with changing language using culture info


I'm using the following msdn article to use different languages in my web application:


I'm following the instructions step by step in VS 2010, and it creates the resource files exactly how it's supposed to. 

However, when I run the program it just doesn't apply it. I don't see the different values from the resource file. 

If I leave my resource file name as sample.aspx.resx, it works. But when I change it to sample.aspx.en-us.resx, it doesn't work. I'm supplying culture from the aspx page's Culter and UICulture properties. I'm being very careful in choosing the correct file name, as that could be the issue,  but it just doesn't work. I also tried changing the culture in the backend code this way:

Changing direction of pop-ups/alerts in RTL


Hello All,

I am not able to change the direction of popups/Alerts in Arabic culture which should be RTL direction.

Rest of my application is changed in above culture, only problem is with popups and alerts.

Thanks in advance.

Changing from Local to WCF


I've been handed an application thats connection string implies a local host connection.

I want to make this connection a remote connection, to a database located on a Server.  I want the client and server to be able to communicate with one another remotely, instead of a local connection.

How does one create the Data Service, and establish end points to Server and Client?  Is it as simple as creating a contract (which I have limited knowledge on constructing), between the two locations, setting up the dataservice, security, and ratifying the 'connetions'?

A smidge of insight, please ;-)

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