B4J Tutorial Msgbox / InputList

Discussion in 'B4J Tutorials' started by Erel, Dec 17, 2015.

  1. Erel

    Erel Administrator Staff Member Licensed User

    Simple message box:
    Code:
    fx.Msgbox(MainForm, "This is the message""This is the title")
    [​IMG]

    Message box with result:
    Code:
    Dim res As Int = fx.Msgbox2(MainForm, "Do you want to save changes?""Save", _
       
    "Yes""Cancel""No", fx.MSGBOX_WARNING)
    If res = fx.DialogResponse.POSITIVE Then
       
    Log("Saving changes...")   
    End If
    [​IMG]

    Note that you can pass "" as the button text to hide a button.
    Code:
    fx.Msgbox2(MainForm, "Invalid value!""Error""I will not do it again""""", fx.MSGBOX_ERROR)
    [​IMG]

    InputList:
    Code:
    Dim items As List = Array("Item #1""Item #2""Item #3""Item #4")
    Dim res As Int = fx.InputList(MainForm, items, "Please choose an item""Items"0)
    If res >= 0 Then
       
    Log($"Selected item: ${items.Get(res)}"$)
    Else
       
    Log("User didn't select any item.")
    End If
    [​IMG]

    The message icon is the same as the owner form icon.
     
    Beja, Matias Ferrer, GGSoft and 11 others like this.
  2. ThRuST

    ThRuST Active Member Licensed User

    Does this also work as the inputbox in VB6? i.e. possible to input text in a textfield?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    ThRuST likes this.
Loading...