Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralLooking for IT Professionals on H1B Visa Transfer/Faster GreenCard Processing Pin
Keith_00221-Jan-04 10:39
Keith_00221-Jan-04 10:39 
GeneralInternationalization in C# Pin
Member 16792721-Jan-04 10:29
Member 16792721-Jan-04 10:29 
GeneralRe: Internationalization in C# Pin
Heath Stewart21-Jan-04 11:16
protectorHeath Stewart21-Jan-04 11:16 
GeneralReferencing a control Pin
Daniel Negron21-Jan-04 10:25
Daniel Negron21-Jan-04 10:25 
GeneralRe: Referencing a control Pin
Heath Stewart21-Jan-04 11:08
protectorHeath Stewart21-Jan-04 11:08 
QuestionModal UserControl, exist some way? Pin
Palladino21-Jan-04 8:48
Palladino21-Jan-04 8:48 
AnswerRe: Modal UserControl, exist some way? Pin
Mazdak21-Jan-04 9:04
Mazdak21-Jan-04 9:04 
AnswerRe: Modal UserControl, exist some way? Pin
Heath Stewart21-Jan-04 11:05
protectorHeath Stewart21-Jan-04 11:05 
GeneralProblem inserting data into a database from a textbox Pin
kymyatha21-Jan-04 7:59
kymyatha21-Jan-04 7:59 
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 

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.