473,394 Members | 1,697 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Form Container

hi all.
in form1 i wrote:
dim MyForm2 as form=new form2

now i want to insert data to the property "id" of form2.
i wrote:
MyForm2.Id=3
but i get an error saying "Id" is not a member of
system...
how can i address the property of form2, contained by
form1?

Nov 21 '05 #1
4 1824
Shachar,

Did you make on form 2 a friend or public field "ID"?
The most simple one is

Friend ID as Integer

in top of your form2 direct beneath the designer created code.

I hope this helps?

Cor
"shachar" <an*******@discussions.microsoft.com>
hi all.
in form1 i wrote:
dim MyForm2 as form=new form2

now i want to insert data to the property "id" of form2.
i wrote:
MyForm2.Id=3
but i get an error saying "Id" is not a member of
system...
how can i address the property of form2, contained by
form1?

Nov 21 '05 #2
Shachar,

Did you make on form 2 a friend or public field "ID"?
The most simple one is

Friend ID as Integer

in top of your form2 direct beneath the designer created code.

I hope this helps?

Cor
"shachar" <an*******@discussions.microsoft.com>
hi all.
in form1 i wrote:
dim MyForm2 as form=new form2

now i want to insert data to the property "id" of form2.
i wrote:
MyForm2.Id=3
but i get an error saying "Id" is not a member of
system...
how can i address the property of form2, contained by
form1?

Nov 21 '05 #3
Hi Shachar

I'm assuming you've added a property called Id to Form2...

The problem could be your declaration (if you have Option Strict On).

You have declared

Dim MyForm2 As Form = New Form2

This means that you have a Form reference, not a Form2 reference - with
Option Strict On, as Form does not have an Id property, you can't access it -
even though the MyForm2 object has an Id property.

Two solutions:

1. Change the declaration to
Dim MyForm2 As Form2 = New Form2
or
Dim MyForm2 As New Form2
(Identical performance)

or turn Option Strict Off...slower, because now reflection will be used to
look up the property and set the value.

HTH

Nigel

"shachar" wrote:
hi all.
in form1 i wrote:
dim MyForm2 as form=new form2

now i want to insert data to the property "id" of form2.
i wrote:
MyForm2.Id=3
but i get an error saying "Id" is not a member of
system...
how can i address the property of form2, contained by
form1?

Nov 21 '05 #4
Hi Shachar

I'm assuming you've added a property called Id to Form2...

The problem could be your declaration (if you have Option Strict On).

You have declared

Dim MyForm2 As Form = New Form2

This means that you have a Form reference, not a Form2 reference - with
Option Strict On, as Form does not have an Id property, you can't access it -
even though the MyForm2 object has an Id property.

Two solutions:

1. Change the declaration to
Dim MyForm2 As Form2 = New Form2
or
Dim MyForm2 As New Form2
(Identical performance)

or turn Option Strict Off...slower, because now reflection will be used to
look up the property and set the value.

HTH

Nigel

"shachar" wrote:
hi all.
in form1 i wrote:
dim MyForm2 as form=new form2

now i want to insert data to the property "id" of form2.
i wrote:
MyForm2.Id=3
but i get an error saying "Id" is not a member of
system...
how can i address the property of form2, contained by
form1?

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input...
5
by: rua17 | last post by:
I'm creating a special button control that creates a log in the database every time is touched. I need to log whe name of the button and the name of the form that contains it In some cases...
2
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am...
6
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the...
25
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
4
by: JackRazz | last post by:
Is there a way to get a components parent form from within the component? Thanks - JackRazz
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
4
by: rodchar | last post by:
hey all, i have an image that i want to put on my form and was just wondering if there is a way to take away the white background on the image (make it transparent)? thanks, rodchar
4
by: Doc John | last post by:
I have a "global" MDI which will contain everything in the application. Since the application itslef will include three different "environments" with their own child Forms, I was wondering if I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.