Formslib use

Discussion in 'Questions (Windows Mobile)' started by kshetarpal, Nov 27, 2007.

  1. kshetarpal

    kshetarpal Member Licensed User

    I have several forms in my application. If the user has a device with larger or smaller screen or changes orientation the forms should redraw accordingly. How do I code that?

    Sub App_Start

    The example above shows the coding for 1 form. Do I need to do that for every form?

    For example

    Sub App_Start

    I have other forms that show up later in the application. Do I add this line each time I have Form.Show line like;

    or Is it written differently?
  2. Erel

    Erel Administrator Staff Member Licensed User

    Each form require a FormLib object to handle screen orientations.
    However you should only create the objects once :
    Sub App_Start
    End Sub

    Sub Button1_Click
    End Sub
  3. kshetarpal

    kshetarpal Member Licensed User

    Form resizing

    Thanks, Do I need to add any additional code for resizing or reorientation will that happen automatically?
  4. Erel

    Erel Administrator Staff Member Licensed User

    You could use the Resize event to change the controls layout:
    Sub flb1_Resize
    if Form1.Height > Form1.Width the
    end if
    end sub
  5. yildi

    yildi Member Licensed User

    I have two form in my application and I have attached a formlib object only to one of them. Or it seems that the resize event fires even if the other form is visible in the screen (my application nicely resizes following the code used in the event that resizes both forms even if only one of them has a formlib object).

    I am not complaining of course, since this allowed me to write only one resize event Sub :) Any idea?

  6. Erel

    Erel Administrator Staff Member Licensed User

    Yes, it is enough to use one resize event as all forms raise this event (even when the forms are not visible).
    Still, one FormLib object is required for each form unless you are using a Panel or some other control that covers the form.
  7. yildi

    yildi Member Licensed User

    Yes, I have panels on both forums. This is maybe the reason...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice