|
-
Apr 24th, 2024, 06:39 PM
#1
Thread Starter
New Member
[RESOLVED] Is building software in VB.NET reliable/fast
Try not to be biased in your response but I am trying to create an RPA in VBA and I am having hard time in figuring the best way to do the app so the UI doesn't get sluggish down the road (the more I add).
So, I had started creating User Control for a panel that fits the sidebar with a lot of buttons on it. But without having the app close and open new forms seems pretty slow at doing things. The only other option is having all the interactions with buttons in the one User Control/Form for it not to appear like it's closing and opening a new window. I simply want it to hide one Panel and Show another panel respective to the button one selects- without it opening and closing a window. I want it to appear in the same form without having all the methods and functions in the app all in one Class.
I hope that makes sense.
-
Apr 24th, 2024, 07:17 PM
#2
Re: Is building software in VB.NET reliable/fast
Are you writing this control in VBA or VB.Net? Those are two different things. Please clarify.
-
Apr 24th, 2024, 07:18 PM
#3
Re: Is building software in VB.NET reliable/fast
First VBA is part of Microsoft Office and not to be confused with VB.Net.
As jmcilhinney recently told you, you can create usercontrols with all the functionality you’d need from a form.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 24th, 2024, 07:27 PM
#4
Thread Starter
New Member
Re: Is building software in VB.NET reliable/fast
 Originally Posted by .paul.
First VBA is part of Microsoft Office and not to be confused with VB.Net.
As jmcilhinney recently told you, you can create usercontrols with all the functionality you’d need from a form.
Create User Controls only lets you reuse certain elements. I want to reuse the form/window without having to keep all the methods and functions within the one class/form. It seems sluggish having excessive lines for different parts of how the app functions.
-
Apr 24th, 2024, 07:34 PM
#5
Re: Is building software in VB.NET reliable/fast
A usercontrol can be used to encapsulate any code you need. It consists of a UI and the code behind that UI. The UI can contain many regular controls. At run-time, you can add a new instance of a usercontrol to your form, or any container control on your form, and you can dispose of that usercontrol.
You don’t seem to be understanding how all this works. Try googling “VB.Net UserControl MSDN” and read up on the subject…
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 24th, 2024, 08:04 PM
#6
Thread Starter
New Member
Re: Is building software in VB.NET reliable/fast
 Originally Posted by .paul.
A usercontrol can be used to encapsulate any code you need. It consists of a UI and the code behind that UI. The UI can contain many regular controls. At run-time, you can add a new instance of a usercontrol to your form, or any container control on your form, and you can dispose of that usercontrol.
You don’t seem to be understanding how all this works. Try googling “VB.Net UserControl MSDN” and read up on the subject…
So I should be only using one form and the rest of usercontrols.
Like for example I want 20/80 view, the 20 is for the sidebar with buttons (user control) then I want the 80 section to be where the buttons go further into functions.
How would you say one can have the 80 section disappear and show the respective button functions in the 80 section? In the same window not closing and re-opening a new window for it? Without creating it all in the one form or usercontrol.
I don't think you can....
-
Apr 24th, 2024, 08:25 PM
#7
Re: Is building software in VB.NET reliable/fast
You can have a form with any layout you choose. I wouldn’t recommend using a usercontrol for your left part. You can cram as much as you choose into one form that only closes when the application exits.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Apr 24th, 2024, 11:53 PM
#8
Re: Is building software in VB.NET reliable/fast
 Originally Posted by Spixol
How would you say one can have the 80 section disappear and show the respective button functions in the 80 section? In the same window not closing and re-opening a new window for it? Without creating it all in the one form or usercontrol.
I don't think you can....
You're just asking the exact same question that I already answered in another thread. As I said there, you can create a user control for each Button and, when the user clicks a Button, you remove whatever control is currently shown and add a new one. Instead of repeating yourself and expecting a different answer, try using the information you've already been provided. Go and do some research on user controls and you'll find that you already have all the information you need, so it's a waste of your time asking for something else.
A user control is designed like a form, i.e. you drag controls from the Toolbox onto the design surface and use the code window to write event handlers and any other code required. Once you build your project, the user control will appear in the Toolbox and can then be used like any other control, i.e. dragged from the Toolbox and dropped on a form or another user control. Just like any other control, it can also be added to and removed from a form at run time. All you need to do is add your Buttons to your form and probably add a Panel for the area to contain the user controls. On each Button Click event, just remove the current user control from the Panel and add a new one. There would be a few more details but that's basically it. It's pretty simple but you seem determined to make it harder.
-
Apr 25th, 2024, 09:07 AM
#9
Re: Is building software in VB.NET reliable/fast
There is a limit to all of that. Controls have to be rendered on the form. If you have a sufficiently complex scenario, you may have to get creative to make the performance work the way you want.
For example, I have a form that largely consists of a grid. There are a handful of labels on the form, perhaps five buttons, and maybe a combobox, but none of that would take any noticeable time to render. The grid, on the other hand, is pretty horrible. The grid consists of some number of user controls arranged in a grid. The width of the grid will always be wider than the width of the display (it will be roughly 30 columns, but the display can only show 5-10 at a time), and the height may be hundreds of rows. Each user control is a NumericUpDown control and either one or two buttons. The color and visibility of the buttons depends on the data in the 'cell'.
Building a form like this isn't terribly difficult, but the performance is horrible if done in the most common fashion. I wanted the grid to be as responsive as something like Excel, and yet just populating the thing was complicated enough, let alone drawing all those controls, toggling the color and visibility of the buttons, and positioning everything.
There are a few ways that I could have handled this, including a FlowLayoutPanel, but what I ended up doing was adding a panel, a horizonal scroll bar and a vertical scroll bar. I then created the maximum number of controls that could be needed, but I didn't draw them anywhere. Only those that could be seen were drawn. What was in them was populated from a datastore based on the position of the vertical and horizontal scroll bars. The performance was excellent. The user thought there were 3000 controls, but there were only a few dozen, the use of which was swapped around as needed. Better yet, once the form was created, it was never destroyed, nor were those controls destroyed, so they never had to be created a second time.
If the performance isn't what you want, you have to get creative. The cost of creating controls happens when the form is created, not when it is shown. Can the form be created ahead of time, such that the cost is paid when nobody cares? Moving controls on a form, or toggling visibility, comes with very little cost. Can you have controls that exist, but are either well above or well below, the form? If so, you can then easily swap them in and out of view by adjusting the top property of the control.
.NET is easily fast enough to handle whatever you want, it just may require you to get a bit creative. Some operations are going to take a long time, and that's life. The key is to figure out how to hide the time taken such that the user doesn't notice it.
My usual boring signature: Nothing
 
-
Apr 26th, 2024, 09:01 PM
#10
Thread Starter
New Member
Re: Is building software in VB.NET reliable/fast
Thanks for the reply, all. Please close this Thread, I think I'm good now! Thanks again.
-
Apr 27th, 2024, 02:01 AM
#11
Re: Is building software in VB.NET reliable/fast
We don't close threads here unless there is an issue with them and we specifically want to prevent new posts. If your issue is resolved then please use the Thread Tools menu to mark the thread Resolved. That way, everyone can see that you don't need any more help without opening the thread and reading it. People can still post to the thread though, if they have a related question or they think they can improve the solution.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|