i have a user control (say myUserControl) that inherits panel, i createsome textboxes on myUserControl dynamically, then i create somemyUserControls on the form dynamically with a loop . of course i changename,location etc.. meanwhile. i have some problems here then. eg: how could i reach each myUserControl and textBoxes on thismyUserControl.it could be betterif i reach them directly, i know renaming a control onthe runtime is useless. what should i do?another issue is, it is not known how many myUserControls on thye from ortextboxes on a myUserControl will be created. i need autoscrollfunctionality. on the panel it works, but on the form it seems, autoscrolldoes not work. thnkz 解决方案 e-mid. There are different ways to do that, i have one recomendation. 1. To reach individual controls, access through properties. example - protected TextBox mMyTextBox; public TexBox MyTextBox{get {return mMyTextBox;}} 2. Autoscroll will work even in design mode of form. I am not sure whyits not working for ur form Shak."e-mid" <someone@somewhere> wrote in messagenews:Oi**************@TK2MSFTNGP09.phx.gbl... i have a user control (say myUserControl) that inherits panel, i create some textboxes on myUserControl dynamically, then i create some myUserControls on the form dynamically with a loop . of course i change name,location etc.. meanwhile. i have some problems here then. eg: how could i reach each myUserControl and textBoxes on this myUserControl. it could be betterif i reach them directly, i know renaming a controlon the runtime is useless. what should i do? another issue is, it is not known how many myUserControls on thye from or textboxes on a myUserControl will be created. i need autoscroll functionality. on the panel it works, but on the form it seems, autoscroll does not work. thnkz e-mid. There are different ways to do that, i have one recomendation. 1. To reach individual controls, access through properties. example - protected TextBox mMyTextBox; public TexBox MyTextBox{get {return mMyTextBox;}} 2. Autoscroll will work even in design mode of form. I am not sure whyits not working for ur form Shak."e-mid" <someone@somewhere> wrote in messagenews:Oi**************@TK2MSFTNGP09.phx.gbl... i have a user control (say myUserControl) that inherits panel, i create some textboxes on myUserControl dynamically, then i create some myUserControls on the form dynamically with a loop . of course i change name,location etc.. meanwhile. i have some problems here then. eg: how could i reach each myUserControl and textBoxes on this myUserControl. it could be betterif i reach them directly, i know renaming a controlon the runtime is useless. what should i do? another issue is, it is not known how many myUserControls on thye from or textboxes on a myUserControl will be created. i need autoscroll functionality. on the panel it works, but on the form it seems, autoscroll does not work. thnkz "Shakir Hussain" <sh**@fakedomain.com> wrote in messagenews:#j**************@tk2msftngp13.phx.gbl... e-mid. There are different ways to do that, i have one recomendation. 1. To reach individual controls, access through properties. example - protected TextBox mMyTextBox; public TexBox MyTextBox { get {return mMyTextBox;}i dont think, this way works. controls created dynamically.another question arised here , is this controls are private by default? 2. Autoscroll will work even in design mode of form. I am not sure why its not working for ur formit scrolls horizontally, but vertical autoscroll does not work.. i did not understand why? Shak. "e-mid" <someone@somewhere> wrote in message news:Oi**************@TK2MSFTNGP09.phx.gbl... i have a user control (say myUserControl) that inherits panel, i create some textboxes on myUserControl dynamically, then i create some myUserControls on the form dynamically with a loop . of course i change name,location etc.. meanwhile. i have some problems here then. eg: how could i reach each myUserControl and textBoxes on this myUserControl. it could be betterif i reach them directly, i know renaming a control on the runtime is useless. what should i do? another issue is, it is not known how many myUserControls on thye fromor textboxes on a myUserControl will be created. i need autoscroll functionality. on the panel it works, but on the form it seems,autoscroll does not work. thnkz 这篇关于动态控制创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-11 22:53