The "focus" always means "keyboard focus" and nothing else. You need to make your control focusable. Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.canfocus.aspx[
^].
You should not use
PictureBox
for your purpose. More exactly, in principle, this is possible, but totally pointless. I explained it in my past answers. Please see:
How do I clear a panel from old drawing[
^],
draw a rectangle in C#[
^],
Append a picture within picturebox[
^].
See also:
Drawing Lines between mdi child forms[
^],
capture the drawing on a panel[
^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^].
In addition to the techniques explained in my answers referenced above, you can organize scrolling in a very simple way. You can use the class already designed for this purpose:
System.Windows.Forms.ScrollableControl
:
http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollablecontrol.aspx[
^].
You need to calculate the "whole area" of the scene in pixels and assign it to the property
AutoScrollMinSize
, which is used by the control to determine how much to scroll in each direction. The property
AutoScroll
should be true. Please see other "
AutoScroll…
" members of this class for further detail.
—SA