Project Crash with no errors

I have a project that uses a tab panel to navigate between several complex layouts. I have a listbox (several actually) that I share between two tabs. One of that tabs that share the listboxes uses a page panel inside the tab panel. When I’m in the pagepanel and double click I can go to a different tab and take the listbox along by changing the parent. Double clicking and changing the tab to move the listbox back to the page panel causes the app to close (like calling quit) with no errors or anything. I couldn’t event turn anything up by stepping through code as it goes to the lengthy listbox paint event after the double click event is done.

Any ideas? I know I don’t have a very good example but it is somewhat complex.

tabpanel = MainTab

'list dblclick event
Sub DoubleClick()
  if MainTab.Value = 0 Then
    MainTab.Value = 1
    return
  end if
End Sub

'code in tabpanel change event
  select case me.Caption(me.Value)
  Case "Orders" 'tab 0
     '.....
  Case "Production" ' tab 1
    POrderList.Parent = PPagePanel
    PPending.Parent = PPagePanel
    PCompletedList.Parent = PPagePanel
    POrderList.Left = 0
    PPending.Left = 0
    PCompletedList.Left = 0
    POrderList.Width = PList.Left + 1
    PPending.Width = PList.Left + 1
    PCompletedList.Width = PList.Left + 1
    POrderList.LockRight = False
    PPending.LockRight = False
    PCompletedList.LockRight = False
    if PSelector.Text = "Panels" Then
      POrderList.Enabled = License("Production")
    ElseIf PSelector.Text = "Trim" Then
    end if
end select

EDIT: Bug report with sample project filed. feedback://showreport?report_id=46569

If you’re on a Mac check the crash log in ~/Library/Logs/DiagnosticReports/
(it may be easier to sort that folder by date modified.)

and put this in the right TARGET on the forums instead of just General

click on “Controls” in the upper right & select “Change Channel”

that helps people be a bit more helpful

Sorry OS Windows 10.

A few more details. If I step through code a mainwindow.resized event is called. If I continue stepping through code the crash occurs when the width is set for the list that was double clicked.

In fact even trying to view the listbox properties in the debugger causes the app to close.

ADD: I’m using version 2015R1

Also if I don’t put a breakpoint in the double click event the resize event is not called. I assume in this case the listbox width adjustment in the tabchange event is causing the crash although I can step through it if I break. I’m going to try this on 2016r4.

[quote=309079:@Neil Burkholder]Sorry OS Windows 10.

A few more details. If I step through code a mainwindow.resized event is called. If I continue stepping through code the crash occurs when the width is set for the list that was double clicked.

In fact even trying to view the listbox properties in the debugger causes the app to close.

ADD: I’m using version 2015R1[/quote]

Have you posted the portion of code where the error occurs ? In which event is it ? TabPanel Change ?

Would it be possible that trying to move the ListBox between panels in that event somehow conflicts with the inner workings of the Tabpanel ?

Could you try doing the same in a button, just to see if it works ?

create a subclass of your listbox with all the “required” logic… and put one instance of each panel.

The subclass should then keep any/everything the same, but you don’t have to worry about “moving” things

The code that does all the moving/resizing is in place (in the tabchange event) and works fine. In fact double clicking the listbox to change to tab 0 works but changing to tab 1 I get this weird crash.

My list box is to complex to describe. I probably should have started out with something like that, but now I just want to avoid breaking anything. Ugh… Too many timers and hidden consequences…

Ok a timer worked. I already have a 100ms timer set up to take care of issues like this, I guess I’ll add it to the pile. It seems a little strange though to be getting a crash instead of an error.

[code]'use this time mainly for user interface related problems, such as selection and focus
if TempFlag Then
MainTab.Value = 1
TempFlag = False
end if

'other code…
[/code]

Try not to make a huge pile of timers, you’ll go insane.

I suspect tab 1 simply does not exist yet at the moment you try to make it parent of the listbox.

The tab is always there (added in the IDE). My first post included the code that is executed in the tabchange event. The only code being called from the double click event is MainTab.Value = 1 .

Here is a test project. I didn’t test Mac or Linux.

Tested on 2015r1, 2016r3, 2016r4.1

  • Run project
  • Navigate to tab 0
  • Double click the listbox
    SPLAT

Note that clicking the listbox from tab 1 is no problem also clicking it to navigate back to tab 1 I not always a problem, but most often when first navigating to tab 0 via the tabs rather than the listbox double click.

feedback://showreport?report_id=46569