I am trying to pass the information from form 1 object to form 2 object. all I am getting is a blank screen on form 2.
here is what I have so far
on form 1 I have :
Private Sub btnTestResults_Click(sender As Object, e As EventArgs) Handles btnTestResults.Click
Dim obb As New frmElevatedResults
obb.val = lstHighCholesterol
Option Strict On
Public Class frmElevatedResults
Public Property val As Object
Private Sub frmElevatedResults_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'This Load event displays the results of the elevated cholestoral levels above 200.
lstResults = CType(val, ListBox)
I assume here that
lstHighCholesterol is not
empty and is also a
ListBox control. Your
Form 1 code is already correct. Try this:
Public Class frmElevatedResults Public val as New ListBox Private Sub frmElevatedResults_Load(sender As Object, e As EventArgs) Handles MyBase.Load For Each itm in val.Items lstResults.Items.Add(itm) Next End Sub ...