.net - Moving cursor position? -
with below code, want shift cursor on screen point (200,200) works fine, when move mouse (with hand) cursor returns original location. doing wrong?
i running xp
on kvm
virtual machine running on linux
host - not should effect how program runs.
i have tried other methods suggested various bulletin boards same effect.
public class form1 private sub form1_load(byval sender object, byval e system.eventargs) handles me.load system.windows.forms.cursor.position = new point(200, 200) end sub end class
thank-you comments.
<global.microsoft.visualbasic.compilerservices.designergenerated()> _ partial class form1 inherits windows.forms.form ' inherits system.windows.forms.form 'form overrides dispose clean component list. <system.diagnostics.debuggernonusercode()> _ protected overrides sub dispose(byval disposing boolean) if disposing andalso components isnot nothing components.dispose() end if mybase.dispose(disposing) end sub 'required windows form designer private components system.componentmodel.icontainer 'note: following procedure required windows form designer 'it can modified using windows form designer. 'do not modify using code editor. <system.diagnostics.debuggerstepthrough()> _ private sub initializecomponent() me.suspendlayout() ' ' 'form1 ' me.autoscaledimensions = new system.drawing.sizef(6.0!, 13.0!) me.autoscalemode = system.windows.forms.autoscalemode.font me.clientsize = new system.drawing.size(292, 266) me.name = "form1" me.text = "form1" me.resumelayout(false) end sub end class public class form1 private sub form1_load(byval sender object, byval e system.eventargs) handles me.load dim abc new point abc.offset(200, 200) cursor.position = pointtoscreen(abc) end sub end class
the partial class above generated integrated development environment. last section contains suggested code. have done nothing regard "mouse move" event. however, in past test made protected override sub the on mouse move , code step through sub in debug mode when moved cursor. thinking behind if override sub in base class - prevent doing in base class mouse move ( . such moving cursor original location ) . not sure whether override class prevented or perhaps cursor being moved original location method in base class - can not see.
is possible able debug , step code part of base class - way see going on. when step debugging, shows methods in classes not methods in base class.
yes tried on windows xp 32-bit native - no virtual machines , cursor.position = new point (200,200) works expected. problem must virtual machine set up. tried on both virtual box , kvm , both did not handle cursor position command properly.
Comments
Post a Comment