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

Stupid Object declaratoin question

I am so stupid that Got a object declaration question, Anyone, please be
kind to reply me.

I got a datagrid which got a button in each row , the user will do the
searching in it,
If the user do the searching, I will decarre a form and show it. ( as
follow)
1st) Dim frmSearch as New frmCompanySearch
2nd) frmSearch.setting= myObjectSetting
3rd) frmSearch.showdialog()

Now I am confuse that datagrid contains many many rows, if the user process
the above code, it seems It will declare many many frmSearch object, right
?? Will it waste resources ???

I think I can decalre 1st) line once , and put 2nd) line in form_load() ,
right ??
Anydifference ??

Thanks for your kind reply.
Nov 21 '05 #1
2 941
What grid are you using? Standard datagrid doesn't have buttons, but others
do in which case it will send key information with that button. You want to
declare it when the button is clicked itself... Well, maybe you do, it
kinda depends on the application, you could have it so the form is declared
only once, and you declare as a class level variable, then upon changing
rows, you call a procedure to update the form
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I am so stupid that Got a object declaration question, Anyone, please be
kind to reply me.

I got a datagrid which got a button in each row , the user will do the
searching in it,
If the user do the searching, I will decarre a form and show it. ( as
follow)
1st) Dim frmSearch as New frmCompanySearch
2nd) frmSearch.setting= myObjectSetting
3rd) frmSearch.showdialog()

Now I am confuse that datagrid contains many many rows, if the user process the above code, it seems It will declare many many frmSearch object, right
?? Will it waste resources ???

I think I can decalre 1st) line once , and put 2nd) line in form_load() ,
right ??
Anydifference ??

Thanks for your kind reply.

Nov 21 '05 #2
Hi,

When you use showdialog the procedure showing the form waits
until the form closes before going to the next line of code. The garbage
collector should dispose of the used frmsearch when the procedure is done.

Ken
------------------
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I am so stupid that Got a object declaration question, Anyone, please be
kind to reply me.

I got a datagrid which got a button in each row , the user will do the
searching in it,
If the user do the searching, I will decarre a form and show it. ( as
follow)
1st) Dim frmSearch as New frmCompanySearch
2nd) frmSearch.setting= myObjectSetting
3rd) frmSearch.showdialog()

Now I am confuse that datagrid contains many many rows, if the user process
the above code, it seems It will declare many many frmSearch object, right
?? Will it waste resources ???

I think I can decalre 1st) line once , and put 2nd) line in form_load() ,
right ??
Anydifference ??

Thanks for your kind reply.

Nov 21 '05 #3

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

Similar topics

38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
1
by: Amar | last post by:
I have a created 2 single signon projects that works fine, by using IIdentity, my stupid question is that how do i clear the User object. After the user navigates through the sites by clicking...
2
by: Ron Weldy | last post by:
I read that you don't need .cs files to deploy but I suppose if you are trying to reconstruct someone's work, you will need these files. Is that correct?
3
by: STom | last post by:
Ok, if I have a class: Public Class MyXClass Public Property X as Integer ..... End Class In my code if I have two instances of this class: Dim myX1 as new MyXClass
6
by: Adam Smith | last post by:
I have posted this and similar questions repeatedly and can't even raise a single response. I am being led to believe that this then 'Must be a stupid question' although people say that there is no...
6
by: Sullivan WxPyQtKinter | last post by:
How to get the length of a file via build-in file object support? In Visual Basic there is len(file) of something like that. But in python, where is this property? Sorry for this stupid...
6
by: Malvolio | last post by:
I know this is a *really* stupid question but what the hell is visual c++? I downloaded it and it doesn't seem to work. It isn't like any c++ compiler I ever saw before and the manual on the...
2
by: Lynx101 | last post by:
Hi, Is this a stupid question? Senario: Two tables linked together with an ID number. Question: When using a combo box, which refences another table by indexed autonumber, is there a way to...
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...
0
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...

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.