Re: UserControl HELP

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Enrico Gobbo" <gobboe@xxxxxxxx> wrote in message
news:%23Mhs3TbzFHA.2792@xxxxxxxxxxxxxxxxxxxxxxx
> Good afternoon
> i've a big problem. I spent a lot of time for create an ocx as flessible
> as possible, but now it result very heavy in the project. My project read
> from a database how many control load and than load the page. (eg. with 70
> controls my page spent 10 seconds for load)
> I need to know if there is some tips for the create a faster ocx. I've
> read somewhere in the net, that there is a way to create it without his
> handle ("windowless") and someone suggest me to use the LINE method
> instead insert other objects in the ocx. is it correct? I've tried to
> insert 100 "custom" button in form1, and 100 standard button in form2.
> Opening form2, my pc spent less time than open form1... WHY?
>
> I hope that someone could help me, and i apologize for my horrible english
> (i'm italian..)
>
> Thanks Enrico

UserControls have a lot of overhead. First, they have to load the controls
you place on them and then the form has to load the UserControl. This can
easily be twice as slow. The more controls you have embedded in the
UserControl, the slower it'll get. There's really no way around that....

You can set the UserControls Windowless property = True and use "Microsoft
Windowless Controls" for command buttons, etc. That may help. Setting the
HasDC property = False may save a few resources too.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..


.



Relevant Pages

  • UserControl HELP
    ... I spent a lot of time for create an ocx as flessible as ... a database how many control load and than load the page. ... I need to know if there is some tips for the create a faster ocx. ...
    (microsoft.public.vb.controls)
  • Re: The bloated get bloatier
    ... I use my own customized version of the PDW ... My avoidance of controls is partly due to using ... The OCX really just uses a "wizard" to write the API ... If you want to use the Wise installer you could ...
    (microsoft.public.vb.general.discussion)
  • Re: The bloated get bloatier
    ... My avoidance of controls is partly due to using ... The OCX really just uses a "wizard" to write the API ... in the Redist folder with the next service pack. ... if you try to install a new system file it will get replaced. ...
    (microsoft.public.vb.general.discussion)
  • RE: Usage of AppDomain.CreateInstanceFromAndUnwrap method
    ... The reason for other failures is that Controls are not inherited from ... so the program will attempt to load them into the ... Create an AppDomain, do a CreateInstanceAndUnwrap on ... Assemblies in to a seprate ...
    (microsoft.public.dotnet.framework.clr)
  • Re: The Command event of dynamically loaded controls
    ... to load a hierarchical list of folders and files from a database and display ... I'll need to load the folder list in the first pass to wire up the ... controls and corresponding event handlers. ... > and triggers events. ...
    (microsoft.public.dotnet.framework.aspnet)