A few questions regarding FormLib

Discussion in 'Questions (Windows Mobile)' started by N1c0_ds, Sep 17, 2008.

  1. N1c0_ds

    N1c0_ds Active Member Licensed User

    I just started messing with formlib and I have a few questions the help file doesn't really answer.

    -Do I have to add a new FormLib object for every form and context menu? Can't I just make a new Flb1.New1("form",B4PObject(1)) for each form with the same object?

    -What is the B4PObject(1) argument?

    Thanks in advance!
     
  2. Ricky D

    Ricky D Well-Known Member Licensed User

    formlib

    Hi,

    I started to use it too.

    I am using context menus on my forms.

    You only need to initialise the formlib object once. I do it in AppStart.

    I'm not sure what the B4PObject(1) argument is. Here is a snippet of my code


    flb.New1("frmMain",B4PObject(1))

    contextMain.New1
    contextMain.AddItem("Set Shift Date")
    contextMain.AddItem("Suburbs")
    contextMain.AddItem("Owners")
    contextMain.AddItem("Fare Types")
    contextMain.AddItem("Toll Wheres")
    contextMain.AddItem("Exit")
    flb.AddContextMenu("frmMain",contextMain.Value)

    ctxtFares.New1
    ctxtFares.AddItem("Add New")
    ctxtFares.AddItem("Edit")
    ctxtfares.AddItem("Delete")
    ctxtFares.AddItem("Close")
    ctxtFares.AddItem("Exit Application")
    flb.AddContextMenu("frmFares",ctxtFares.Value)


    flb is a FormLib object and contextMain & ctxtFares are ContextMenu objects

    here is the _Click event for contextMain

    Sub contextMain_Click
    Select contextMain.SelectedText
    Case "Set Shift Date"
    frmChangeShiftDate.show
    Case "Suburbs"
    frmSuburbs.Show
    Case "Owners"
    frmOwners.Show
    Case "Fare Types"
    frmFareTypes.Show
    Case "Toll Wheres"
    frmTollWheres.Show
    Case "Exit"
    mnuExitMain_Click
    End Select
    End Sub


    regards, Ricky
     
  3. N1c0_ds

    N1c0_ds Active Member Licensed User

    Thanks a lot!

    Now I can't manage to make MinimizeBox work.

    This is in my AppStart menu:

    I don't yet use formlib anywhere else except for Flb1_Resize

    :sign0085:
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You should create a FormLib object for each form. The memory footprint of each object is very small.
    B4PObject(1) is a reference to an internal structure which is accessed by FormLib.
     
  5. N1c0_ds

    N1c0_ds Active Member Licensed User

    But what about MinimizeBox? I don't see where things went wrong :(

    The rest works well, :D

    UPDATE:
    Suddenly works o_0

    I might have done something wrong somewhere :)

    Odd.

    UPDATE 2:
    Only on one of my apps!
     
    Last edited: Sep 18, 2008
  6. Erel

    Erel Administrator Staff Member Licensed User

    If it still doesn't work please upload your code and I'll check it.
     
  7. N1c0_ds

    N1c0_ds Active Member Licensed User

    Okay I got it working on both apps.

    Apparently you have to stick the two lines together without anything between them... I think...

    Anyway I should upload my apps soon :D
     
Loading...
  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