Click here to Skip to main content
15,867,453 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem inserting data into a database from a textbox Pin
Guillermo Rivero21-Jan-04 8:03
Guillermo Rivero21-Jan-04 8:03 
GeneralRe: Problem inserting data into a database from a textbox Pin
Mazdak21-Jan-04 8:05
Mazdak21-Jan-04 8:05 
GeneralRe: Problem inserting data into a database from a textbox Pin
Heath Stewart21-Jan-04 8:22
protectorHeath Stewart21-Jan-04 8:22 
GeneralRe: Problem inserting data into a database from a textbox Pin
gmu0421-Jan-04 22:26
gmu0421-Jan-04 22:26 
QuestionRaw socket handling tcp syn without SIO_RCVALL ? Pin
rantanplanisback21-Jan-04 7:42
rantanplanisback21-Jan-04 7:42 
GeneralArrayList Pin
hornshoj21-Jan-04 7:41
hornshoj21-Jan-04 7:41 
GeneralRe: ArrayList Pin
Heath Stewart21-Jan-04 8:17
protectorHeath Stewart21-Jan-04 8:17 
GeneralScrolling on mouse down/move Pin
MrEyes21-Jan-04 6:15
MrEyes21-Jan-04 6:15 
Just about everybody will have seen or used this functionality I am trying to replicate, most likely in Acrobat viewer - or a variant which is [CTRL + Cursor] in most scrollable windows.

I am working on a simple image viewer, that overrides the onPaint for the form and renders a given image directly onto it (i.e. no picture boxes etc). Image display is working as it should but I am now looking for a way to scroll the form using mouse events. For example, the user clicks and holds on the form, when they move the mouse pointer the form is scrolled in the direction of mouse travel.

The mouse events to do this are relatively simple :
private int mouseDownX;
private int mouseDownY;
private bool mouseDown = false;

private void ImageViewer_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
  mouseDown = true;
  mouseDownX = e.X;
  mouseDownY = e.Y;
}

private void ImageViewer_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
  mouseDown = false;
}

private void ImageViewer_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
  if (mouseDown)
  {
    //vertical scroll
    if (e.X > mouseDownX)
    {
      //scroll south
    }
    if (e.X < mouseDownX)
    {
      //scroll north
    }

    //Horizontal Scroll
    if (e.Y > mouseDownY)
    {
      //scroll west
    }
    if (e.Y < mouseDownY)
    {
      //scroll east
    }
}


The problem is that I cant find any way of scrolling the form (this), does anybody know of a solution?

post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
GeneralRe: Scrolling on mouse down/move Pin
Mazdak21-Jan-04 6:22
Mazdak21-Jan-04 6:22 
GeneralRe: Scrolling on mouse down/move Pin
Heath Stewart21-Jan-04 7:51
protectorHeath Stewart21-Jan-04 7:51 
GeneralRe: Scrolling on mouse down/move Pin
Mazdak21-Jan-04 8:02
Mazdak21-Jan-04 8:02 
GeneralRe: Scrolling on mouse down/move Pin
Heath Stewart21-Jan-04 8:11
protectorHeath Stewart21-Jan-04 8:11 
GeneralRe: Scrolling on mouse down/move Pin
Mazdak21-Jan-04 8:19
Mazdak21-Jan-04 8:19 
GeneralRe: Scrolling on mouse down/move Pin
MrEyes21-Jan-04 12:53
MrEyes21-Jan-04 12:53 
GeneralRe: Scrolling on mouse down/move Pin
Heath Stewart21-Jan-04 8:06
protectorHeath Stewart21-Jan-04 8:06 
GeneralRe: Scrolling on mouse down/move Pin
MrEyes22-Jan-04 0:15
MrEyes22-Jan-04 0:15 
GeneralRe: Scrolling on mouse down/move Pin
Heath Stewart22-Jan-04 4:24
protectorHeath Stewart22-Jan-04 4:24 
GeneralAdding Column to a ListView Pin
Guinness4Strength21-Jan-04 5:37
Guinness4Strength21-Jan-04 5:37 
GeneralRe: Adding Column to a ListView Pin
Heath Stewart21-Jan-04 5:52
protectorHeath Stewart21-Jan-04 5:52 
GeneralRe: Adding Column to a ListView Pin
Guinness4Strength21-Jan-04 5:57
Guinness4Strength21-Jan-04 5:57 
GeneralRe: Adding Column to a ListView Pin
Heath Stewart21-Jan-04 7:50
protectorHeath Stewart21-Jan-04 7:50 
GeneralRe: Adding Column to a ListView Pin
Guinness4Strength22-Jan-04 8:33
Guinness4Strength22-Jan-04 8:33 
GeneralRe: Adding Column to a ListView Pin
Heath Stewart22-Jan-04 9:26
protectorHeath Stewart22-Jan-04 9:26 
GeneralRe: Adding Column to a ListView Pin
Guinness4Strength22-Jan-04 9:33
Guinness4Strength22-Jan-04 9:33 
GeneralRe: Adding Column to a ListView Pin
Heath Stewart22-Jan-04 9:39
protectorHeath Stewart22-Jan-04 9:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.