I have many needs that require the user to be able to click on a tile item to toggle the tile from large to regular size. In addition I also need the ability for the user to double click on the item to direct them to another window based on information contained on the tile they double clicked on. Currently there is only a double click event for the tile control which I am unable to get the info necessary from the tile item. Is it possible to add a double click event for tileitems ?
Thank you for your question. You can get the required TileItem and all its information in the TileControl.DoubleClick event handler by the mouse position via the TileControl.CalcHitInfo method.
Attached is a small sample project that illustrates this approach.[VB.NET]
Private Sub tileControl1_DoubleClick(sender As Object, e As EventArgs) Dim hi As TileControlHitInfo = tileControl1.CalcHitInfo(tileControl1.PointToClient(MousePosition)) If hi.InItem Then MessageBox.Show(hi.ItemInfo.Item.Text) End If End Sub
Thanks John for your quick response. The code worked from a strictly programmatic standpoint, so I appreciate the sample code.
I still have an issue though, as the tile itemclick event gets raised before the tile control double click event, so my interface gets confusing to the user, as I use the itemclick event to toggle islarge property. So the user sees the tile toggle from large to small or vice versa, and then they see the action relative to the double click event.
So, I am wondering if this issue should be changed to a suggestion or a bug report, as you have answered my original question, but I believe if we had an Item double click event, that maybe it would work smoother.
If you see another way for me to handle this without it becoming a suggestion, I would appreciate it.