Moving a lot of objects at once VB.NET - vb.net

I am creating a form that has a lot Picture Boxes (around 2400), I am trying to figure out a way to move all of them all at once instead of it lagging the whole form and taking 10 seconds to move all of them. I am completely stuck. Is it even possible?
I have tried using CType, but it doesn't seem to work.

Related

MS Access inserted new pages to tab control on a form and .oldvalue not working

I have a form with a tab control and 6 pages. I then added some new tabs and the .oldvalue is not captured for any pages from where the new pages were inserted. The existing process for keeping an audit log of changes which works just fine for the pages up to where the new page is inserted. Then nothing past that page is being captured.
I've created vba to see what is getting passed to the sub where the audit tracking begins and everything up to the new page shows up nothing from the new page and beyond is being passed. I had read somewhere that inserting pages can cause problems with a how form remembers things (?) but I can't find where I read that.
I've tried exporting the form to text and re-importing and that didn't solve the problem. I've also gone as far as recreating the form and tabs and creating the pages in order and then copy/pasting the controls and that didn't work either. There are now 9 pages and about 150 controls, so I'd hate to have to recreate every control from scratch. I'm absolutely stumped and can't find anything about this issue. There are also no sub-forms or anything like that going on. (For the record, I've inherited this beast and pretty much forced to work with it without benefit of a full re-design. And yes, on sub-forms and 150 fields in single table. slaps head).
Not sure what was causing the issue, but there were a bunch of controls no longer in use that were set to be not visible. I'm guessing the reason they weren't deleted is because there was quite a bit of vba controlling those on whether they were activated or not and some other things. Deleting those and cleaning up the vba seems to have done the trick. False alarm, everyone. As you were.

How do I show a “Loading . . . please wait” with gif image message in vb.net for a long loading form?

vb.net
I have a form(called Form1) that is very slow because it contain datagridview how load data from sql server.As a result the form takes a long time to loaded.
So I create a form_Wait and in the load event of Form1 I put
Form_wait.showdialog()
Load_datagridveiw1("Select * from table1")
Form_wait.close()
My problem is the Form_Wait will be appear but the gift inside it (rectangular progress bar) is not showen ?
I used VS 2015
You cannot meaningfully show and animate GIF in a same thread as your UI sits. You would have to use a BackGroundWorker, which is basically a separate thread. Then the animation will work smoothly and the UI thread will run fine too. There are plenty of BackGroundWorker tutorials on the web.
But a huge warning horn rings reading your words. If it is such a huge amount of data causing the slow loading, I would strongly suggest to reconsider how do you fetch the data. Introducing meaningful filters and pagination are basic ways to tackle this.

Unding Macro actions made during a SlideShow

I want to ask about something, that can probably get pretty complex. I'm working on an interactive presentation with some game elements (stuff that use variables, a timer, score, etc.) and I've noticed that any changes a macro makes (changing the string in a text box, disabling certain shapes) when you run a slide show remain after the slide show has finished. Given that the presentation and the games therein are made to be played multiple times, I would like to avoid having the user click "Undo" a million times or closing and opening the presentation again. I am not sure how to go about this, but I've had a few ideas:
The first one was to track every change that's being made, while the game is running and then have a macro use the "Undo" command the required number of times, once the slideshow is stopped. Creating an Event Handler however proved to be rather complicated. I'm not that well versed in VBA and reading how many declarations, classes and whatnot have to be made, the fact that I cannot find in the reference what the Event for simply ending the slideshow is (that is, when the user presses Esc, not when the last slide has been reached) not to mention the fact that it's very easy to make a mistake that can render all of that code useless, makes me think this is needlessly complicated just for a single event.
Another idea was to set the initial values of the properties that are to be changed during the game, along with the needed variables at the start of the game, so that no matter what changes are made in the presentation, the values will always be reset when running it, although that would make it tedious to tweak things and make big changes to the game, when needed.
Can you give me some suggestions on how I should go about this problem? Which method would be better? Is there some way to make it so that nothing a macro does during a slide show makes actual changes to the presentation itself? I'd very much like to hear your thoughts.
Thanks!

Generating about thousand or more controls with ExtJS

We have decided to use ExtJS for one of our large application's web-remake and we will have to generate screens/forms where we will have to render about thousand or more controls either in complete editable grid of in forms.
So may I know what is the best approach in doing so?
I have tried generating about thousand controls and it takes about more than 6 seconds on client-side and that too is going to be dependent on Client configuration about which I am positive that it will be at-least dual-core system most of the time.
But more than 6 seconds on localhost is like 10 seconds over the Internet so I am worried, I still have a choice of mixing normal html form/controls when there is high load but then it will miss the ExtJS touch (combo/number controls etc.), so any help or if you had similar experience do share.
Will XTemplate be faster in above case? I am still new to ExtJS so do share best practices if you know/used.
The best approach is not to do it this way. Creating thousands of controls will need huge amounts of memory, no matter how you do it. As you noticed, this makes an application extremely slow.
The solution is to keep the elements on the server and use some form of paging to create only the elements that the user can actually see.
Paging can be explicit ("Load next 10 rows") or implicit by firing an event when the scrollbar hits the right/bottom end and loading more rows.
Usually, you can even hide this from users. Always load a whole row (hiding elements in the same row which aren't visible because the browser window is too narrow usually doesn't help much).
On the server, you will know how many rows you have. Load the first 20 rows and display them. Find the height of the rows (ideally, they should be all the same height) and create an empty DIV below the 20 rows which expands the scrolled view. This makes it appear as if all the rows are there (user sees correct scrollbar which doesn't jump while scrolling).
As soon as that empty div comes into view, load more rows and shrink it.

VB.NET - Duplicate existing form in FOR loop

Hey, I'm building a code editor app in VB.NET (Framework 4.0) and it opens all ".por" files into individual forms consisting of a MenuBar and TextBox (multi-line).
Currently I have 20 forms (all duplicates of the first on I designed) and if there are say 4 ".por" files in a directory, the first four will open up while the others hide.
I think it would be far more efficient by coding a new form For each item in form1's ListView...but I want the next so many to be a copy of the first form I designed since I spent a good bit on it.
Thanks in advance!
I decided to use tabs instead.
It wasn't difficult, the problem was I didn't know how to use a form I couldn't see.
By sticking to tabs and making a huge IF statement, simply making a new tab for each new file, and I'm getting used to using controls which haven't actually been created with the designer.
Just passing through a wall here...