big OK button in msgbox

Discussion in 'Questions (Windows Mobile)' started by Georg, Sep 12, 2009.

  1. Georg

    Georg Member Licensed User

    How to realize a big ok button in a messagebox "cMsgboxOK" so that it can be pressed with the finger?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The message box is not customizable.
    You can however show a panel with a large button instead of the msgbox.
     
  3. focusrocker

    focusrocker Member

    Is there some sort of panel that can be made smaller? Maybe a quarter of the pocket pc screen. I have several used for such an animal
     
  4. Ariel_Z

    Ariel_Z Active Member Licensed User

    Try this (note that I use form1.text for dubug only):

    Code:
    Sub Globals
       
    'Declare the global variables here.
       jump = -10
    End Sub

    Sub App_Start
       AddForm(
    "Form1""Form1")
       AddPanel(
    "Form1""Panel1"0, Form1.Height, Form1.Width, 100)
       AddTimer(
    "Timer1")
       panel1.color = cRed
       AddButton(
    "Form1""B2"005050)
       form1.text = panel1.top
       timer1.interval = 
    10
       AddButton(
    "Panel1""B1"90205050)
       Form1.Show
       
    End Sub

    Sub Timer1_Tick
       panel1.top = panel1.top + jump
       form1.text = panel1.top

       
    If panel1.top + panel1.height <= form1.height Then
          panel1.top = form1.height - panel1.height
          timer1.enabled = 
    False
       
    End If
    End Sub

    Sub b2_Click
       timer1.enabled = 
    True
    End Sub
    Sub B1_Click

       AppClose
    End Sub
     
  5. Georg

    Georg Member Licensed User

    how to realize that the app waits on a click on the ok button in the panel like it works at msgbox?
     
  6. Cableguy

    Cableguy Expert Licensed User

    As long as the customized panel in the top-most z-order, the app will wait for the button click, as long as there is no other loops or for-next going on...
     
  7. Georg

    Georg Member Licensed User

    excuse me, what das it mean "in the top-most z-order"
     
  8. Ariel_Z

    Ariel_Z Active Member Licensed User

    Z-order is the order in which controls (visible or invisible) controls on the form are sorted.
    Use textbox1.sentToBack to send a control (textbox1 in this case) to be the last one. This means if anything else is at the same place it will be drawn on top of this textbox. Use control.BringToFront for the opposite action. The last one you place is the last on the z order. So, "last on the z-order" means - totaly visible, on top of others. If your panel (like in the sample code above) is the last one and is visible, the user can click the button. Note that the program does not necessarily wait, this depends on what you do after you show the panel. But if it's there you can click it.
     
  9. Ariel_Z

    Ariel_Z Active Member Licensed User

    Georg - did you manage to use this code? is it working ok? I think of publishing it as an added module and would like to have some feedback if you've used it.

    Best regards,
    Ariel
     
  10. Georg

    Georg Member Licensed User

    Ariel - I used this code. But it doesn't work like I wont. I need a wait after calling the OK panel, because there a some commands behind calling the panelok the sub.

    p.E.

    sub test
    ....
    ....
    panelok
    .... ' here the app should wait
    ....
    form1.show
    end sub
     
    Last edited: Sep 20, 2009
  11. Ariel_Z

    Ariel_Z Active Member Licensed User

    What do you mean "waiting after calling the ok panel"? Could you upload your source code? even with a regular MsgBox?
     
    Last edited: Sep 21, 2009
  12. klaus

    klaus Expert Licensed User

    Hi Georg,

    The way I see is to have either:
    - a full screen size panel with the OK button
    - a panel that covers all parts of the screen where the user can do something, in order that the only thing he can do is to press the OK button when the OK Panel is displayed.

    Attached a small example.
    B1 opens a panel that covers all Buttons and the TextBox
    B2 opens a full screnn panel
    B3, B4, B5 are just other buttons

    Best regards.
     
    Last edited: Sep 25, 2009
  13. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Can I just ask if you intend to use the program on the device or is it intended as a desktop only application?

    I'm thinking along the lines that you could you Agrahams FormEXDesktop library and a child form which if being shown you program for all other subroutines to ignore click and key presses events etc.

    Just an idea.

    Regards,
    RandomCoder
     
  14. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Attached is a very quick example of what I had in mind (and fortunately you don't need to add any conditional statements to check if the form is being shown as it automatically takes priority).
    This is applies only to the desktop though!

    Regards,
    RandomCoder
     
  15. klaus

    klaus Expert Licensed User

    Hi RandomCoder,
    The example I posted is intended for the device.

    On the desktop, as your example shows it, a FormEx can be shown as Modal. This mode doesn't exist on the device, Forms are always full size.

    Best regards.
     
  16. agraham

    agraham Expert Licensed User

  17. klaus

    klaus Expert Licensed User

    Hi Andrew,
    Sorry, I missed your library.
    But the Modal mode is not supported on the device.

    Best regards.
     
  18. agraham

    agraham Expert Licensed User

    I tried it but I removed it as it caused several problems, including the app hanging, if the user used a Task Manager to switch to another task and then back. I think that MessageBox, which is modal, on the device is cleverer than it looks and does some things deep in the system to avoid these hangs and to draw itself. For example it's not obvious how it draws the wireframe when it moves, I tried to emulate that but cannot see a way to do it at the moment :(.
     
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