Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3780

IllegalCastException even when controls share a common parent

$
0
0

Feedback Case Number: https://tracker.xojo.com/xojoinc/xojo/-/issues/76713

Here’s a fun one to look out for. I suspect it has something to do with the fact that the new API2 controls have some magic happening under the hood.

Var Controls() As DesktopUIControl = Array(TextField1, TextField2, TextField3)
If PopupMenu1 IsA DesktopUIControl Then
  Controls.Add(PopupMenu1)
  MessageBox("No bug")
Else
  MessageBox("PopupMenu1 is not a DesktopUIControl")
End If

You’ll get an IllegalCastException on Controls.Add(PopupMenu1). The controls are their obvious types and do exist. The bug report has a sample project.

8 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 3780

Trending Articles