Help please: Changing PagePanel programatically

Hello,

I have SegmentedControl1 and PagePanel1 in a window

I click on SegmentedControl1 with the mouse to change the Page on PagePanel1 … That works

Now I want to do it programatically because I want to do a screen capture of each page as they appear.

// I do not want to use Drawinto because the colours are not displayed as they should,

So I have…

[code] Dim segment As SegmentedControlItem
Dim position As Integer
For position = 0 To SegmentedControl1.Items.UBound
SegmentedControl1.Index = position
SegmentedControl1.Items(position).Selected = true

  PagePanel1.Value = position[/code]

The segments on SegmentedControl1 are highlighted appropriately but the pages are not displayed appropriately, they do not change.

How can I fix that?

Thanks.

Lennox

From the code you posted, you’re changing PagePanel11.Value within a for…next loop. That is going to change so quickly that you will only see the last value.

Thanks Roger,

But now I use

[code]PagePanel1.Value = 0
While PagePanel1.Value < 11
  

  PagePanel1.Value = PagePanel1.Value + 1
  msgbox Str(PagePanel1.Value)
Wend

[/code]

and PagePanel1.Value does not go beyond 1, Page 0 is displayed then Page1

Why is that?

Thanks

Lennox

What are you trying to accomplish by changing your PagePanel.Value within a tight loop?

assuming you have 11 pagepanels defined to start with… they only update at the end of each event loop… so nothing really changes until AFTER your “WEND” statement anyways…

Hi Roger,

Now I want to do it programatically because I want to do a screen capture of each page as they appear.

// I do not want to use Drawinto because the colours are not displayed as they should,

Thanks.

Lennox

Hi Dave,

So how can I change the PagePanel pages so that I can take a picture of each page?

Thanks.

Lennox

OK, I found it,

I use i as the variable and change the page panel and SegmentedControl with i

Thanks.

lennox