[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DocumentView confusion


Il 16/11/25 17:11, Lee ha scritto:
I am currently looking at that example you posted. Button1 is used to go to the page number the user has entered into TextBox1.

I'm not sure what you are suggesting be asked. Why doesn't using .EnsureVisible on a page index do what exactly? If you mean ensure that the first or last page is visible, perhaps they would. Have you tested and found they do not?

The code in the project, "Try dv[Val(TextBox1.Text) - 1].EnsureVisible", is much simpler. Using Try makes testing if the value of TextBox1 (minus 1) is outside the bounds of the page indexes unnecessary. And just in case anyone is confused, "Else If (Val(TextBox1.Text) - 1) >= dv.Count Then" should actually be "Else If (Val(TextBox1.Text) - 1) > dv.Max Then".

To be used as an example project to everyone has common ground for discussion, the project should have another Button that prints out the values of the properties in question on-demand after the user has caused the page(s) in view to change. However, I think that for this particular discussion, that project may be unnecessarily complex.


Hi Lee,

I simply suggested using the official test on a shared document, for better understanding:
https://gitlab.com/gambas/gambas/-/tree/master/comp/src/gb.form/.src/Test?ref_type=heads

I apologize and will withdraw from the conversation.

Regards
Gianluigi


Follow-Ups:
Re: DocumentView confusionFabien Bodard <gambas.fr@xxxxxxxxx>
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>
References:
DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>
Re: DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>
Re: DocumentView confusionFabien Bodard <gambas.fr@xxxxxxxxx>
Re: DocumentView confusiongbWilly <gbWilly@xxxxxxxxxxxxxx>
Re: DocumentView confusionGianluigi <gradobag@xxxxxxxxxxx>
Re: DocumentView confusionGianluigi <gradobag@xxxxxxxxxxx>
Re: DocumentView confusionLee <t.lee.davidson@xxxxxxxxx>