473,609 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ShowDial og(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.Da taBindings.Add( New Binding("Text", cData, "Value1"))

Where can I define the binding? When I try to define it after
InitialiseCompo nent() I got "OutOfMemor y" 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 "AlreadyBou nd" 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 22 '05 #1
4 1938
Hi Marcin,

I thought I asked you yesterday in the language.vb group what you mean with
"open" because that does not exist as far as I know, and that is just the
part not in your sample.

However I do not see that message either.

There is a show and hide and there is a way to create a form new.

Jest method robizc nowe alle nie jest do otwarte jak ja wiem.

Moze bardzo sle

:-)

Cor
Nov 22 '05 #2
Hi Marcin,

I thought I asked you yesterday in the language.vb group what you mean with
"open" because that does not exist as far as I know, and that is just the
part not in your sample.

However I do not see that message either.

There is a show and hide and there is a way to create a form new.

Jest method robizc nowe alle nie jest do otwarte jak ja wiem.

Moze bardzo sle

:-)

Cor
Nov 22 '05 #3
All I write regards VB.NET and each Form object in .NET has OpenDialog
method and has
Load event. I have no problem opening the form, or creating it. My problem
is with data binding and with strange behaviour of Open Event (contrary to
what the docs say).
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:Os******** ******@TK2MSFTN GP11.phx.gbl...
Hi Marcin,

I thought I asked you yesterday in the language.vb group what you mean with "open" because that does not exist as far as I know, and that is just the
part not in your sample.

However I do not see that message either.

There is a show and hide and there is a way to create a form new.

Jest method robizc nowe alle nie jest do otwarte jak ja wiem.

Moze bardzo sle

:-)

Cor

Nov 22 '05 #4
All I write regards VB.NET and each Form object in .NET has OpenDialog
method and has
Load event. I have no problem opening the form, or creating it. My problem
is with data binding and with strange behaviour of Open Event (contrary to
what the docs say).
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:Os******** ******@TK2MSFTN GP11.phx.gbl...
Hi Marcin,

I thought I asked you yesterday in the language.vb group what you mean with "open" because that does not exist as far as I know, and that is just the
part not in your sample.

However I do not see that message either.

There is a show and hide and there is a way to create a form new.

Jest method robizc nowe alle nie jest do otwarte jak ja wiem.

Moze bardzo sle

:-)

Cor

Nov 22 '05 #5

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

Similar topics

1
281
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 fData as new frmData()
4
252
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 fData as new frmData()
0
222
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 fData as new frmData()
0
811
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 fData as new frmData()
0
223
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 fData as new frmData()
0
8095
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7030
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6068
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2541
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1690
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.