How to display loading dialog when a button clicked

592 Views Asked by At

I need to to display "Loading..." when I pressed a button in the window. How can I make it? If it is a streaming, like the dots are mingled it will be more better.

I just try with a .txt file that contain the word "Loading..." as FileOpenex() function ,But it doesn't work..


integer li_FileNum
string ls_Emp_Input
li_FileNum = FileOpen("C:\Users\Exactus\Desktop\New.txt", &
TextMode!)
FileReadEx(li_FileNum, ls_Emp_Input)
2

There are 2 best solutions below

0
On

global variables:

integer  gi_max_dots=7;
string  gs_dots;

You can use predefined timer() event on the window. When you want this to start, put

timer(1); //This will trigger timer  after each second interval 
          //so try changing the loading text there.

Using this code in timer() event should work :

if  gi_max_dots > len(gs_dots)  then 
    gs_dots=gs_dots+".";
else
    gs_dots="";
end if

i have assumed a static text control showing this status here.

st_1.text="Loading"+gs_dots;

And when need to stop the timer event

Timer(0);
st_1.text="";
0
On

Create a popup window that contains the text Loading ... when you press the button open the window and at the end of the process the close.