Home > Net > Winform, only load the scroll bar in the panel of the current problem of custom controls
Winform, only load the scroll bar in the panel of the current problem of custom controls
Time:09-25
In a winform project has a panel, the initial loading with images according to the local folder to generate custom controls is loaded into the panel, but the number of images in the folder has reached several thousand, full load memory would burst, so before the current solution is to display only 32 (32 just fill a panel), and the rest through search to find, but it will mislead the users think that only 32, excuse me: I want to make the number according to the pictures to occupy the position of the panel, open the panel of the scroll bar, but only load the visible part of the data (i.e. only 32 controls generated images, other data temporarily not loaded), when the user drag the scroll bar to corresponding location of the data to be loaded according to the location of the scroll bar, drag data disposed in the viewing area, is there a good solution you great god? Or did show just a little, grateful!
CodePudding user response:
Page, the panel have highly restricted, I lost more than 65535 below, If loading parts, when the display calculation problems (such as beyond the form part of regional cohesion, the scroll bar to move to position, etc.), Price is too big, the brain uneconomic, Originally I did it, so do not bottom go to, paging,
CodePudding user response:
WPF without limit, then don't overflow control, can be embedded WPF component System.. Windows Controls. The ScrollViewer give it a try
CodePudding user response:
You can customize the the maximum value of the scroll bar , to prompt the amount of content; And according to the scroll position, to dynamic display image,
Stick to the tenth floor has a complete example, the sample of one million objects, according to