Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody!
I am researching a possibility to create a progess bar in QlikView. The basic idea is to change a textbox width depending on how far my macro has worked.
When you place the code for resizing in a condition, the changes in the interface occures after the macro has completely run.
How can I change something in the interface sumultaneously during the macro is running?
Example:
sub testProgressBar
set textBox = ActiveDocument.GetSheetObject("TX01")
set frame = textBox.GetFrameDef
pos = frame.Rect
strIterable = ""
for i = 0 to 10000
strIterable = strIterable & " " & i
if i = 3000 then
pos.Width = 350
textBox.SetFrameDef frame
end if
next
end sub
Thanks for your suggestions
Regards
Hi,
I have solved the problem:
In VBScript exists a function which pauses the code flow until the actualizations have been done. I.e. ActiveDocument.GetApplication.WaitForIdle must be placed after a "refresh" in the interface.
for i = 0 to 10000
strIterable = strIterable & " " & i
if i = 3000 then
pos.Width = 350
textBox.SetFrameDef frame
ActiveDocument.GetApplication.WaitForIdle
end if
next
Aquele abraço
Hi,
I have solved the problem:
In VBScript exists a function which pauses the code flow until the actualizations have been done. I.e. ActiveDocument.GetApplication.WaitForIdle must be placed after a "refresh" in the interface.
for i = 0 to 10000
strIterable = strIterable & " " & i
if i = 3000 then
pos.Width = 350
textBox.SetFrameDef frame
ActiveDocument.GetApplication.WaitForIdle
end if
next
Aquele abraço
Hi
I have solved the problem:
In VBScript exists the function ActiveDocument.GetApplication.WaitForIdle , it must be placed after a change in the interface. Doing it he code flow is paused and the refresh is done 😉
Hatus wrote:for i = 0 to 10000
strIterable = strIterable & " " & i
if i = 3000 then
pos.Width = 350
textBox.SetFrameDef frame
ActiveDocument.GetApplication.WaitForIdle
end if
next
Aquele abraço
Hi
I have solved the problem:
In VBScript exists the function ActiveDocument.GetApplication.WaitForIdle , it must be placed after a change in the interface. Doing it he code flow is paused and the refresh is done 😉
Hatus wrote:for i = 0 to 10000
strIterable = strIterable & " " & i
if i = 3000 then
pos.Width = 350
textBox.SetFrameDef frame
ActiveDocument.GetApplication.WaitForIdle
end if
next
Aquele abraço
Hi
I have solved the problem:
In VBScript exists the function ActiveDocument.GetApplication.WaitForIdle , it must be placed after a change in the interface. Doing it he code flow is paused and the refresh is done 😉
Hatus wrote:for i = 0 to 10000
strIterable = strIterable & " " & i
if i = 3000 then
pos.Width = 350
textBox.SetFrameDef frame
ActiveDocument.GetApplication.WaitForIdle
end if
next
Aquele abraço
Hi
I have solved the problem:
In VBScript exists the function ActiveDocument.GetApplication.WaitForIdle , it must be placed after a change in the interface. Doing it he code flow is paused and the refresh is done 😉
Hatus wrote:for i = 0 to 10000
strIterable = strIterable & " " & i
if i = 3000 then
pos.Width = 350
textBox.SetFrameDef frame
ActiveDocument.GetApplication.WaitForIdle
end if
next
Aquele abraço
Hi,
I'm also looking to find a solution on how to make a textbox resize in macro to make a progress bar. Had problems with docunits and conversion. This post gave me the answer:
http://community.qlik.com/message/60704#60704
I only needed the part:
tblrect.Width = 120
tbl.SetRect(tblrect)
Thought I would share, hope it helps!