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

reopening form many times and Data Binding

Hello!

My question regards opening (and re-opening) Form and the Load event.

I have a main form (frmMain) and I also have a data form (frmData).

In the main form I have created:

Private fData as new frmData()

And later, as my application is running, I open data form many times (even a
hundred times) like this

fData.RowId = ... ' there exists a public property of frmData called RowId
If (fData.ShowDialog(Me) = DialogResult.OK) THEN
...
ELSE
...
ENDIF

frmData has a private object of some class called "classData" and then I
want to bind some controls on frmData to properties in classData, like this:
....
Private cData as New classData()
.....
Me.txtValue1.DataBindings.Add(New Binding("Text", cData, "Value1"))

Where can I define the binding? When I try to define it after
InitialiseComponent() I got "OutOfMemory" Exception, so I decided to move it
and do the binding during the "Load" event (as It was shown in some MSDN
Magazine articles). But it appears that the Load event fires EVERY TIME
frmData opens (contrary to what the documentation states: Load Event -
"Occurs before a form is displayed for the first time.") and the second time
my form is opened
binding fails. I could create a variable "AlreadyBound" of type Boolean but
it seems a dirty solution for me. And then again I feel creating fData every
time it is opened and the disposing of it is a waste of time and resources.

I wait for any good clues regarding:
- how to open form multiple times (this is what I do with fData)
- how to have some operations performed every time the form is opened (like
clearing the data fields) while other only the first time the form is opened
(or when it is created in the memory)
- when (and how) to do the binding

Thanks in advance. Marcin Floryan.
Nov 20 '05 #1
0 808

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

Similar topics

1
by: Marcin Floryan | last post by:
Hello! My question regards opening (and re-opening) Form and the Load event. I have a main form (frmMain) and I also have a data form (frmData). In the main form I have created: Private...
5
by: amanatio | last post by:
I have a huge form with many data bound controls on it and 34 tables in database (and of course 34 data adapters and 34 datasets). The form is extremely slow to design (huge delay when I go to code...
21
by: Simon Verona | last post by:
Hope somebody can help! I want to automatically be able to add code to the initialize routine on a Windows form when I add a custom control that I've written to a form. Specifically, I'm trying...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
8
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a...
8
by: BD | last post by:
Moving from MS Access to .Net using C# languag. Problem trying to duplicate form with structure as follows: 1. Main form 'Work Order' displayed as textboxes 2. subform 'Customers' textboxes...
3
by: trgpham | last post by:
Hi all, I have a question and really hoping you guys can help or point me to the right direction. MY SCENARIO: I need to design a screen which show up all the questionnaires and the users can...
8
by: Randy | last post by:
I have a form with 36 text boxes on it. I have everything working for the user to make changes to existing records or to add new ones. When I come to the point of passing this data on to the data...
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: 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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.