Android Question [B4X] XUI Msgbox with

mrossen

Active Member
Licensed User
Longtime User
Hi,

I am trying to make at msgbox with my own custom layout and a close button in the top right corner.

I have made a nice msgbox with my own layout based on this example :
https://www.b4x.com/android/forum/t...ss-platform-views-and-dialogs.100836/#content.

But I don't know how to make the close button in the top (maybe in the title bar) and not to have the buttons in the bottom.

B4X:
#Region List Of Colors custom Dialog
Sub CreateDialogLayout
    
    Dialog.BackgroundColor = Colors.White
    DialogPanel = xui.CreatePanel("")
    DialogPanel.SetLayoutAnimated(0, 0, 0, 400dip, 400dip)
    DialogPanel.LoadLayout("info")
    
End Sub

B4X:
    If DialogPanel.IsInitialized = False Then
        CreateDialogLayout
    End If
    Wait For (Dialog.ShowCustom(DialogPanel, "", "OK", "")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Base.Color = DialogPanel.Tag
    End If

Any one know if this can be done.
I am quite a newbie to this XUI stuff and I am not clear with it yet.

Mogens
 

Brandsum

Well-Known Member
Licensed User
If you don't want any buttons at the bottom then don't send any button text.
B4X:
Dialog.ShowCustom(DialogPanel, "", "", "")

Add a button on the top right corner in your layout file. On that button click just call,
B4X:
Dialog.Close(XUI.DialogResponse_Cancel)
 
Last edited:
Upvote 0
Top