![xojo click and hold on a listbox xojo click and hold on a listbox](https://i.imgur.com/GrO3VUp.png)
In the case below, pp accesses different pictures (pctOne etc.).
#Xojo click and hold on a listbox code
In a project of mine I have this piece of code that switches pictures in the CellTextPaint event.
![xojo click and hold on a listbox xojo click and hold on a listbox](https://demo.pdfslide.net/img/380x512/reader024/reader/2021022100/55cf9a2b550346d033a0b473/r-2.jpg)
The "IllegalCastException" seems to make sense, since "CellTag" is a Variant, and Pictures are not included as a Variant.Īlthough, if I leave that Statement in, the Picture is drawn, which to me, seems kind of strange, and makes me wonder if it will cause a problem somewhere later. G.DrawPicture me.CellTag(row, 0), 0, 0 // I get an "IllegalCastException" here when I try to run the Experimental App. If I comment out this line of Code - "If c.PictureAvailable Then" and also the "End If" that goes with it, in the CellBackgroundPaint, and only have:Ĭase 0 // Is this the column to draw into? This did work to solve the immediate problem - The Pictures are drawn in the Cell that was clicked, with no duplication in any of the other Cells. in the CellBackgroundPaint of the ListBox:Ĭase 0 // This is the column to draw into Possibly, I misunderstood what you were suggesting, but this is what I tried as far as following your suggestion.ĬurrentPic = c.Picture // CurrentPic is a Global Property as Picture You should store the picture on the cell itself ( as a celltag ) at some time, for example when clicking on it, then the cellBackgroundPaint should use the stored picture to draw itself Our registered office is 101 Teversham Drift, Cambridge CB1 3LL.
#Xojo click and hold on a listbox software
Light Blue Software is a company registered in England and Wales, number 6671025. Voted 'Best Professional Product of the Year 2012' by members of the SWPP.PS If you like Light Blue and our customer service, then we’d love it if you’d take a moment to vote for us in the ‘Best Software’ and ‘Best Customer Service’ categories at. YValue = System.MouseY - Me.Top - Self.Top // Calculate current mouse position relative to top of ListBox. XValue = System.MouseX - Me.Left - Self.Left // Calculate current mouse position relative to top left of ListBox This is in the MouseDown of the Listbox: P.Graphics.DrawPicture me.Backdrop, 0, 0, me.Width, me.Height, 0, 0, me.Width, me.Height This is what is in the MouseDown of a Canvas:ĭim p as new Picture(me.Width, me.Height) I have tried adjusting the X Coordinate, and the Width of the original Picture,īut no matter what I do, I can't get the whole Picture to display in the Cell. I am trying to add RowPictures to a Listbox from the Clipboard.Įverything works fine, except that the width RowPicture is only about 75% of the