Hey Frank -
With VB.Net, whenever you see anything that is listed on the properties
grid, you can always see what it does "behind the scenes" by expanding the
"Windows Generated Code" region at the top of the code page. Try to bind it
in a manner that you'd like to do at runtime, and then mimic the code that
is generated wherever you want to do it at runtime.
For your other problem, you can talk to other forms if you can access the
form's object directly. IE, you can't just declare a new Form2; you have to
find Form2 and talk to it. You might want to create some module that keeps
track of all opened and closed forms, so that you have an easy way to talk
to all of the open forms. Finally, any objects that you want to change on
that form will need wrapper functions to change whatever properties you
want on them. For example, you might want a public property that allows you
to change the text on a given label. Alternatively, you could declare the
label as public and then muck with it directly.
HTH
Josh Moody
VSU Team
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
Content-Class: urn:content-classes:message
From: "Frank Yamrick" <fy******@compuserve.com>
Sender: "Frank Yamrick" <fy******@compuserve.com>
Subject: setting binding data
Date: Wed, 10 Sep 2003 14:54:20 -0700
Lines: 32
Message-ID: <01****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcN35hcDwLdqoH30T8OLQTVXQjf/Zg==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:136492
NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
X-Tomcat-NG: microsoft.public.dotnet.languages.vb
I am trying to program an application that requires a
large number of screnes that are very similar in the
respect that all the bottons and labels interact with each
other with the same relationship. If possible, it seems
it would be easier to set up one standard page where the
text is blank for each radiobutton, button, or label. The
text would then be filled in by specifying the dataset and
databinding information via code under the event
proceedure that is calling that particular form.
At present, the only way I see to set the databinding
information is through the properties table. I am looking
for a way to set it via code:
Problem #2 has to do with writing code that effects
a form other than the one that has the focus.
The following is an example of what I would like to do
(using made up code that does not work):
Under the click event for a particular button -
frmForm1.label1.databindings.set (Dataset1, Table1, A2)
whereas: frmForm1 would specify the form where the
required change needs to take place.
label1 would designate the tool that needs to be
bound
databindings.set would allow me to set the
databinding for that control, as oposed to setting it on
the properties table
(dataset1, table1, A2) would give the location of
the information to be bound.
Any help would be appreciated.
Sincerely, Frank