tags:

views:

67

answers:

2

I have a form1 with a binding source created by VS as

private System.Windows.Forms.BindingSource bindingSource1

I have changed private to public

Sill Intellisence doesn't recognize

form1.BindingSource

within another form2

Form1 form1 = new Form1();
form1.bindingSource1 = ...;

Why ?

A: 

You haven't shown the name of the field - only the type. For instance, it might be:

public System.Windows.Forms.BindingSource bindingSource1;

You also need to make sure your form1 variable is of the right type (rather than just Form). If you could give a short but complete example, that would help.

Personally I would avoid making the fields public though - if you really need to expose the binding source, use a property to access it.

Jon Skeet
You're right but I made a mistake in the question so I corrected. But it doesn't work.
programmernovice
Again, a short but *complete* example would help. The code you've got looks like it will work, if the field is genuinely public. What error message are you getting?
Jon Skeet
+1  A: 

In this particular example, BindingSource is the type of the member. It's not clear from your sample what the name of the member is. So you can in effect be binding to the wrong name

JaredPar