Note that there are some explanatory texts on larger screens.

plurals
  1. POChild Form Object References Returning Incorrect Values
    primarykey
    data
    text
    <p><strong>Problem</strong></p> <p>So I have a parent form that uses a child form to contain various settings to be used. The settings form has things such as datagridviews, textboxes, listviews, etc. The parent form is called "MainForm" and the settings one is called "SQL_Settings". Whenever referencing items from the child form within the parent form I get incorrect results. </p> <p>For example:</p> <pre><code>Sql_settings.Datagridview.rows.count </code></pre> <p>Returns a value of 1 but I can physically see there are definitely more than one rows in it.</p> <p>Another example:</p> <pre><code>Sql_settings.Textbox1.text </code></pre> <p>Returns blank even though there is text in it.</p> <p><strong>Possible reason?</strong></p> <p>I started having this problem after experimenting with multi-threading and delegates. I had at one point used the command:</p> <pre><code> System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = False </code></pre> <p>but then deleted it deciding to do it correctly instead. I am thinking maybe something is "left over" from this command? I could be entirely wrong on that though..</p> <p><strong>Additional Information</strong></p> <pre><code> Dim data_to_pass(2) As Object data_to_pass(0) = SQL_Settings.DataGridView1(3, sql_on).Value data_to_pass(1) = part_information data_to_pass(2) = ListView8 Dim add_results_thread As New Threading.Thread(AddressOf add_results_to_list) add_results_thread.IsBackground = True add_results_thread.Priority = Threading.ThreadPriority.Highest add_results_thread.Start(data_to_pass) </code></pre> <p>This does run multiple times however. Once the thread is done then it is triggered to run another one after. Perhaps this is causing the issue?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload