locked
Form autoscroll bar position RRS feed

  • Question

  • Hi,
     
    I am developing an application on windows mobile 5.0 and i have a simple form with a textbox at the bottom.  When i open the SIP i am able to resize the form with this line of code:


    Private Sub SIP_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles SIP.EnabledChanged

    Me.Bounds = SIP.VisibleDesktop

    If SIP.Enabled = True Then

    TextBox1.Focus()

    End If

    End Sub

    I now would like the screen to automatically jump to a textbox i have at the bottom of the form.  Does anyone know how to do this?  I was messing round with the screen rectangle position but cant seem to get anything to do this.

    Thanks in advance!
    Rob McCabe
    Monday, August 11, 2008 12:54 PM

Answers

  • I assume you're using compact framework (or else there would be a method called ScrollIntoView()).
    You should be able to set the AutoScrollPosition for the form. Get the position of the TextBox and apply the proper offset (positive values) to the AutoScrollposition. For AutoScrollPosition to be working you must set AutoScroll to True.

    /Calle


    - Still confused, but on a higher level -
    Tuesday, August 12, 2008 8:27 AM

All replies

  • I assume you're using compact framework (or else there would be a method called ScrollIntoView()).
    You should be able to set the AutoScrollPosition for the form. Get the position of the TextBox and apply the proper offset (positive values) to the AutoScrollposition. For AutoScrollPosition to be working you must set AutoScroll to True.

    /Calle


    - Still confused, but on a higher level -
    Tuesday, August 12, 2008 8:27 AM
  • Smart Devices VB and C# Projects forum is here. Thanks!
    Friday, August 15, 2008 9:39 AM