A Alex_197 Well-Known Member Licensed User Longtime User Feb 7, 2026 #1 Hi all. I have a situation where I need to show a message to the user in red to get his attention. I have an option in my app that erases all the data from the local database. A few times users accidentally clicked on the link Reset the application. Right now it shows XUI.Msgbox2Async with the text that tells the user that all the data will be erased. As it usually happens 8 out of 10 users don't read what the message says and hit Yes. So I want to show this message in red. I know that in B4i XUI.Msgbox2Async doesn't support a string created in CSBuilder so I'm using B4XDialog. I call this reset from 2 places - from the link on the login screen which is a page and it works fine. And from the menu. As far as I understood I can't use a B4XDialog in class. Am I correct? If so - what are my options? Thanks
Hi all. I have a situation where I need to show a message to the user in red to get his attention. I have an option in my app that erases all the data from the local database. A few times users accidentally clicked on the link Reset the application. Right now it shows XUI.Msgbox2Async with the text that tells the user that all the data will be erased. As it usually happens 8 out of 10 users don't read what the message says and hit Yes. So I want to show this message in red. I know that in B4i XUI.Msgbox2Async doesn't support a string created in CSBuilder so I'm using B4XDialog. I call this reset from 2 places - from the link on the login screen which is a page and it works fine. And from the menu. As far as I understood I can't use a B4XDialog in class. Am I correct? If so - what are my options? Thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2026 #2 Alex_197 said: As far as I understood I can't use a B4XDialog in class. Am I correct? Click to expand... You can use it from a class. There is nothing special about B4XDialog. Upvote 0
Alex_197 said: As far as I understood I can't use a B4XDialog in class. Am I correct? Click to expand... You can use it from a class. There is nothing special about B4XDialog.
A Alex_197 Well-Known Member Licensed User Longtime User Feb 8, 2026 #3 Erel said: You can use it from a class. There is nothing special about B4XDialog. Click to expand... But what about these lines? Code: Copy Base = pg.RootPanel Dialog.Initialize (Base) What will be a Base in class? Do I need to send a reference to my class from a page? Upvote 0
Erel said: You can use it from a class. There is nothing special about B4XDialog. Click to expand... But what about these lines? Code: Copy Base = pg.RootPanel Dialog.Initialize (Base) What will be a Base in class? Do I need to send a reference to my class from a page?
Erel B4X founder Staff member Licensed User Longtime User Feb 8, 2026 #4 You can implement everything you need in a class and create an instance of this class in each page. And pass the Root panel to the class Initialize method. Upvote 0
You can implement everything you need in a class and create an instance of this class in each page. And pass the Root panel to the class Initialize method.
A Alex_197 Well-Known Member Licensed User Longtime User Feb 8, 2026 #5 Erel said: You can implement everything you need in a class and create an instance of this class in each page. And pass the Root panel to the class Initialize method. Click to expand... Thanks. I will try. Upvote 0
Erel said: You can implement everything you need in a class and create an instance of this class in each page. And pass the Root panel to the class Initialize method. Click to expand... Thanks. I will try.