Click here to Skip to main content
15,904,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a form and I set Auto Scroll = true . I have a problem when active the form . Form is not focus to top position . It auto scroll down to bottom of form . How can I fix it ? ( I mean when I call a form It will show the top of Form then I can use scroll bar to scroll down ).

Sorry about my english skill .

Thanks
Posted

Read about it here, you may be confused on what this actually does:

Click me![^]
 
Share this answer
 
i use this code :

C#
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd,UInt32 Msg,UInt32 wParam,UInt32 lParam);

//........
//........
private void MainForm_Load(object sender,EventArgs e)
{
  //........
  //...........
  splitContainer1.Panel1.Focus();
     int WM_MOUSEWHEEL = 0x20A;
     Message msg = new Message();
     msg.Msg = WM_MOUSEWHEEL;
     msg.WParam = (IntPtr)786432000;
     msg.HWnd = splitContainer1.Panel1.Handle;
     SendMessage(msg.HWnd,(UInt32)msg.Msg,(UInt32)msg.WParam,(UInt32)msg.LParam);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900