Click here to Skip to main content
16,020,253 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to implement Trees ... Pin
Eric Dahlvang13-Jul-06 7:54
Eric Dahlvang13-Jul-06 7:54 
QuestionTrying to print an html page without to load it in asp.net Pin
sai_akkina13-Jul-06 5:12
sai_akkina13-Jul-06 5:12 
AnswerRe: Trying to print an html page without to load it in asp.net Pin
Not Active13-Jul-06 5:24
mentorNot Active13-Jul-06 5:24 
AnswerRe: Trying to print an html page without to load it in asp.net Pin
Dave Kreskowiak13-Jul-06 6:38
mveDave Kreskowiak13-Jul-06 6:38 
GeneralRe: Trying to print an html page without to load it in asp.net Pin
sai_akkina13-Jul-06 18:11
sai_akkina13-Jul-06 18:11 
Questionmoving an image Pin
john3413-Jul-06 5:00
john3413-Jul-06 5:00 
AnswerRe: moving an image Pin
Christian Graus13-Jul-06 5:09
protectorChristian Graus13-Jul-06 5:09 
AnswerRe: moving an image Pin
Robert Rohde13-Jul-06 5:17
Robert Rohde13-Jul-06 5:17 
Hi,

yes I think you'll have to handle the mentioned mouse events to get it done. Without being tested the following solution might work:
private void picBox_MouseDown(object sender, MouseEventArgs e)
{
   downX = e.X;
   downY = e.Y;
   vertValue = pnl.VerticalScroll.Value;
   horizValue = pnl.HorizontalScroll.Value;
   inMove = true;
}

private void picBox_MouseMove(object sender, MouseEventArgs e)
{
   if (inMove)
   {
      int diffX = e.X - downX;
      int diffY = e.Y - downY;

      pnl.VerticalScroll.Value = vertValue + diffX;
      pnl.HorizontalScroll.Value = horizValue + diffY;
   }
}

private void picBox_MouseUp(object sender, MouseEventArgs e)
{
   inMove = false;
}

The general approach here is to save the values of the scrollbars and the mouse position when the button was pressed and then use those to calculate the new scrollbar positions when the mouse moves.
AnswerRe: moving an image Pin
Dave Kreskowiak13-Jul-06 6:51
mveDave Kreskowiak13-Jul-06 6:51 
AnswerRe: moving an image [modified] Pin
Dave Kreskowiak13-Jul-06 10:19
mveDave Kreskowiak13-Jul-06 10:19 
GeneralRe: moving an image Pin
john3413-Jul-06 23:03
john3413-Jul-06 23:03 
QuestionPassing more than one QueryString Pin
leckey13-Jul-06 4:28
leckey13-Jul-06 4:28 
AnswerRe: Passing more than one QueryString Pin
Not Active13-Jul-06 4:55
mentorNot Active13-Jul-06 4:55 
QuestionDoing own ToolStripItems… Pin
anderslundsgard13-Jul-06 4:26
anderslundsgard13-Jul-06 4:26 
AnswerRe: Doing own ToolStripItems… Pin
Ed.Poore15-Jul-06 13:04
Ed.Poore15-Jul-06 13:04 
QuestionConverting a Color to RGB (not ARGB) Pin
anderslundsgard13-Jul-06 3:27
anderslundsgard13-Jul-06 3:27 
AnswerRe: Converting a Color to RGB (not ARGB) Pin
stancrm13-Jul-06 3:34
stancrm13-Jul-06 3:34 
GeneralRe: Converting a Color to RGB (not ARGB) Pin
anderslundsgard13-Jul-06 4:06
anderslundsgard13-Jul-06 4:06 
GeneralRe: Converting a Color to RGB (not ARGB) Pin
Christian Graus13-Jul-06 4:22
protectorChristian Graus13-Jul-06 4:22 
GeneralRe: Converting a Color to RGB (not ARGB) Pin
stancrm13-Jul-06 8:40
stancrm13-Jul-06 8:40 
QuestionRun store procedure in C# setup Pin
Saamir13-Jul-06 3:22
Saamir13-Jul-06 3:22 
AnswerRe: Run store procedure in C# setup Pin
Christian Graus13-Jul-06 4:23
protectorChristian Graus13-Jul-06 4:23 
GeneralRe: Run store procedure in C# setup Pin
BoneSoft13-Jul-06 6:21
BoneSoft13-Jul-06 6:21 
GeneralRe: Run store procedure in C# setup Pin
Saamir16-Jul-06 8:25
Saamir16-Jul-06 8:25 
Questionproblem with starting windows forms ? help plz... Pin
cmpeng3413-Jul-06 2:59
cmpeng3413-Jul-06 2:59 

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.