Accessing another forms controls

  • Thread starter Thread starter Tim Fitzgerald
  • Start date Start date
T

Tim Fitzgerald

Hello all,

I have no problem accessing another form in my app.. however, when I try to
access a ListView on a different form, I come up empty... Basically,

Dim pForm As New frmMain
Dim iCount As Integer

iCount = pForm.lvJobList.Items.Count

iCount is zero? Yes, there are items there. :)

All I want to do is update the ListView item if the user modifies a job in
any way or add an item to the ListView if the user adds a new job (all this,
"before" the child form is closed)..

Thanks..

--Tim
 
Ensure the access modier is set to freind and then access it through the
form. If it is the parent then

me.parentform.control.TheMethodYouNeed()

Regards OHM
 
Sorry that should have read Modifiers, you'll find it under the Design
Category.

Regards - OHM
 
OHM,

Thanks for the response.. However, I could not accomplish what I needed to
using your example. I "think" ParentForm is used in a MDI scenario.

What I did get to work was:

Me.Owner.Controls.Item

I just iterated through each one until I found the control I needed to
manipulate.

Thanks!

--Tim
 
Back
Top