mrossen Active Member Licensed User Longtime User Oct 7, 2019 #1 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. Code: #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 Code: 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
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. Code: #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 Code: 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 Oct 7, 2019 #2 If you don't want any buttons at the bottom then don't send any button text. Code: Dialog.ShowCustom(DialogPanel, "", "", "") Add a button on the top right corner in your layout file. On that button click just call, Code: Dialog.Close(XUI.DialogResponse_Cancel) Last edited: Oct 8, 2019 Upvote 0
If you don't want any buttons at the bottom then don't send any button text. Code: Dialog.ShowCustom(DialogPanel, "", "", "") Add a button on the top right corner in your layout file. On that button click just call, Code: Dialog.Close(XUI.DialogResponse_Cancel)
mrossen Active Member Licensed User Longtime User Oct 8, 2019 #3 Thank you brandsum. This works perfect Mogens Upvote 0