IMouseStartPan (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example uses a scroll box (TScrollBox) and two labels placed on it in two different positions, one visible and one not. To see the hidden label, right-click the scroll box. A panning window appears, allowing you to scroll the box and see the label.

Code

void __fastcall TForm1::ScrollBox1MouseDown(TObject *Sender, TMouseButton Button,
		  TShiftState Shift, int X, int Y)
{
   /* Verify whether the right mouse button is pressed. If yes, start panning. */
   if (Button == mbLeft)
	  StartPan((unsigned int)ScrollBox1->Handle, ScrollBox1);
}

Uses