473,326 Members | 2,173 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,326 software developers and data experts.

setting binding data

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
Nov 20 '05 #1
1 1966
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


Nov 20 '05 #2

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

Similar topics

0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
8
by: Nevyn Twyll | last post by:
I have a multi-level datalist setup: DataList1 DataList2 MyGrid I have columns explicitly defined for the grid in the html. Sometimes, On the initial Load() of the Page, I want to add extra...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
1
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
19
by: Larry Lard | last post by:
In the old days (VB3 era), there was a thing called the Data Control, and you could use it to databind controls on forms to datasources, and so (as the marketing speak goes), 'create database...
12
by: Joe | last post by:
I might be overworked so please excuse this stupid question... Say I do the following: DataTable table = new DataTable(); myDataAdaptor.Fill(table); dataGrid1.DataSource = table;
12
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use...
1
by: dani | last post by:
Hi Everyone, I wanted to create a large text box (a textarea) for displaying some large information for editing. I am using a DetailsView control with an SQL data source, but every time I try to...
1
by: DeanB | last post by:
Please excuse my ignorance here as I have not used WPF for long, but what is the statement that tells what the "local:" identifier is that allows a window event to call a function in a .cs file? ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.