Form problems

Discussion in 'Questions (Windows Mobile)' started by Lasse, Oct 6, 2007.

  1. Lasse

    Lasse Member Licensed User

    Hi,

    I have 2 forms a form called Menu that is loaded in the App_Start like:
    Menu.show

    I have a button that loads a form called Order with some tables and a textbox on.

    The problem is that the textbox has a lostfocus sub, so when you press the OK / Close button the menu form is shown but the order form is still active behind it.
    The form title is still Order instead of menu...

    Any ideas ?
     
    Last edited: Oct 6, 2007
  2. kavka

    kavka Member Licensed User

    Hello!

    I have a similar problem.

    The first page of the program is the selecting page, to enter data. The second page is the entering page (a numerical pad). When I enter the number and press the ENTER button on this numerical pad, the number copies on the first page and closes the numerical pad page. But the problem is, that the numerical pad side only hides and does not actually closes. The problem begins when I open the numerical pad again. When I press, lets say button that represents number 1, two number one's appear in the textbox. If I open the numerical pad the third time, three number one's appear in texbox.

    Is it possible to actually close the numerical pad window, without closing the main window.

    Maybe any other suggestion how to solve this problem.

    I have attached the code.

    THX
     

    Attached Files:

  3. alfcen

    alfcen Well-Known Member Licensed User

    Hello kavka,

    Please have a look at the modified source (atteched hereto).

    Code:
    For i = 0 To 9
       AddEvent(
    "b" & i, Click, "Number_Click")
    Next
    must be placed inside AppStart.

    Cheers
    Robert
     
  4. kavka

    kavka Member Licensed User

    Alfcen!! Cool, it works!

    THX!!
     
  5. agraham

    agraham Expert Licensed User

    A suggestion. The labels on the buttons means that part of the buttons are "dead" making the keys feel wrong. Why not put the values in the button text? You can get them back when needed as shown in the attachment.
     

    Attached Files:

  6. alfcen

    alfcen Well-Known Member Licensed User

    Nice suggestion! This also eliminates the problem of centering which is unavailable with labels.
     
  7. kavka

    kavka Member Licensed User

    Hello!

    Thx guys for help so far!

    Agraham. You have solved my next problem, even before I have asked! Great! :sign0060:

    The crlf command is used for next line, right. But when I run the code on PPC, the text moves one line up, not down. Any suggestions?
     
  8. agraham

    agraham Expert Licensed User

    Hmm! I should have tried on the device but I didn't expect the button text to behave differently on the PPC. I'll play with it tomorrow and come back then.
     
  9. kavka

    kavka Member Licensed User

    Hello!

    I have another question.

    How do I create a table, so I can input data and read data out of it. And of course some calculation will be done in it.

    And how can I do the this:

    Let's say that something.text = 85. How can I include this value (85) in If command.

    If something.text > 35 then somethingelse.text = "20"

    THX
     
  10. specci48

    specci48 Well-Known Member Licensed User

    Hi kavka,

    Just define the table in a normal way, add it to a form and add your needed columns. Set the visible property to false. With this the table is not shown on the form but can be used as an internal storage.

    Yes, this is valid basic4ppc coding. Since basic4ppc has an automatic type conversion, you can omit the " and code
    If something.text > 35 then somethingelse.text = 20


    specci48
     
  11. alfcen

    alfcen Well-Known Member Licensed User

    Hello kavka
    The best teacher is sample code. I attach a Table centered application which I put together the other day for another forum member.
    Enjoy!
     
  12. agraham

    agraham Expert Licensed User

    Sure enough googling for "Multiline button Compact framework" it seems that desktop buttons have a multiline feature but it is not enabled on the device. Apparently it can be enabled with a bit of low-level code (so needing a library) but lets not go there!

    It is probably best to ignore me and do what you originally did by having a label for each button - but make them obviously separate from the button so the button isn't "dead" and maybe associate them with their button by some subtle colouring.
     
Loading...