Msgbox2 without dimming screen?

susu

Well-Known Member
Licensed User
Longtime User
How about create a panel with OK button and handle it manually?
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
Yes, but you can disable all views and wait for user's answer. My example code attached. Hope it can help you
 

Attachments

  • panelasmsgbox.zip
    6.5 KB · Views: 209
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If anyone wants to play with modal dialogs, this code will help you get started:
B4X:
public static int Msgbox2(String Message, String Title, String Positive, String Cancel, String Negative, Bitmap Icon, BA ba) {
      AlertDialog.Builder b = new AlertDialog.Builder(ba.context);
      anywheresoftware.b4a.Msgbox.DialogResponse dr = new DialogResponse(false);
      b.setTitle(Title).setMessage(Message);
      if (Positive.length() > 0)
         b.setPositiveButton(Positive, dr);
      if (Negative.length() > 0)
         b.setNegativeButton(Negative, dr);
      if (Cancel.length() > 0)
         b.setNeutralButton(Cancel, dr);
      if (Icon != null) {
         BitmapDrawable bd = new BitmapDrawable();
         bd.Initialize(Icon);
         b.setIcon(bd.getObject());
      }
      AlertDialog ad = b.create();
      anywheresoftware.b4a.Msgbox.msgbox(ad, false);
      return dr.res;
   }
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Thank you so much! I worked through the tutorials for creating libraries, but one of the prerequisites for them is understanding Java, which I don't, so I was in for a tough time coming up with what you cranked out. Thanks again!
:wav:
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…