Visual Basic Forms

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

SolutionWeb

Thread Starter
Joined
Aug 2, 2004
Messages
33
Hi,

I need help please, I am designing an application in Visual Basic and need to create forms but the problem is that I don’t know how many forms I need in advance till I run the application, is there any way that I can create forms at run time similar to textboxes. Also please how can I compile and execute a Visual Basic application automatically at certain time once a week, do I need to write a batch file and if that is the case what would be the command line for that.

Thanks in advance
Regards,
 
Joined
Sep 4, 2003
Messages
4,916
I am confused by you saying that you don't know how many forms will be needed at runtime. What type of info will be displayed on the form and what determines who many forms you will need? Once the project is complete, you can simple compile into an executable and use Windows built-in Task Manager to schedule them to run at various times.

Rollin
 

SolutionWeb

Thread Starter
Joined
Aug 2, 2004
Messages
33
Thanks Rollin,

I am sorry for not being too clear about the problem, in fact I am designing a database reports via Visual basic using forms, the data are provided from tables on the server, now I don’t know how many Data are provided in advance to set a side X amount of forms to display them as a Report. Therefore I am looking for a way to create the forms at the run time and if the number of data are exceeded the size of the form that I can display on the screen than I will generate another from to display the data and so on by having the viewer to click on the next buttom. As for the execution automation when I compile and execute the program then each time the program might display different number of the forms. Does all this make sense?

Thanks for your help
 
Joined
Oct 12, 2003
Messages
3,015
Look into the datarepeater control. You can create a form at runtime

Code:
Dim newfrm as New Form1
but stylistically, I wouldn't.
 

SolutionWeb

Thread Starter
Joined
Aug 2, 2004
Messages
33
Thanks coderitr,

Your solution does make sense, but if I may ask, why you don't like the style?
Is there any performance issue?

Thanks
 
Joined
Oct 12, 2003
Messages
3,015
What if the number of elements exceeds what can be displayed on the second form as well? Create a third? At what point do you stop? The datarepeater control can handle that kind of thing. I've never personally worked with it and you may have to develop a custom control to use it but I think that is the way to go if you're talking about an unknown number of entries to be displayed. Yes, it can be a performance issue if you keep creating instances of a form at runtime but with two or three you probably wouldn't notice a difference. The big deal is that you have to anticipate the sometimes idiotic things your users are going to do with your application. Sure, it works when you feed 10 database rows to it but what happens to it when you give it 1000 or 10000? If you're going to be in the software development field, I urge you to think about these things. I don't mean to be disparaging -- I've been in the business of writing software for over a decade and I've seen users do some remarkably stupid things.
 

SolutionWeb

Thread Starter
Joined
Aug 2, 2004
Messages
33
Thanks very much for your advice, you are right. I don't know of any other solution at this point. Since I had to do some configuration on the data, I switched to Visual basic for doing the configuration. Therefore I decided to display the customized data format in Visual Basic, and in fact after the completion I need to email each of the created forms.
Thanks for your assistance.
 
Joined
Oct 12, 2003
Messages
3,015
SolutionWeb said:
Thanks very much for your advice, you are right. I don't know of any other solution at this point. Since I had to do some configuration on the data, I switched to Visual basic for doing the configuration. Therefore I decided to display the customized data format in Visual Basic, and in fact after the completion I need to email each of the created forms.
Thanks for your assistance.
Why don't you create a paging routine. Display the first 10 or so results and notify the user that there are more results to see. Give them a "next" and "previous" button so they can navigate between pages. Most importantly with this solution, don't load the data until you need it. You'll need some unique identifier on each row (like a sequence number) to make this work.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top