textbox control multiline property at run-time
Author |
Message |
Sean T. Klei #1 / 10
|
 textbox control multiline property at run-time
Hello all, This is my first post to this list so please bear with me if I reveal my newbie status. In my app I am creating a control array of textboxes at run-time. I need to be able to set the multiline property to true but that property is read only at run-time. Does anyone know of a workaround for this? Any help is greatly appreciated. Sean --------------------------------- Code: Private Sub txtBoxLayout() Dim top As Integer Dim wndTxt(100) As TextBox top = 10 i = 0 Do While i < gCount ' dynamically create a text box for each image selected Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, Picture2) wndTxt(i).top = top wndTxt(i).Width = 320 wndTxt(i).Height = 240 'wndTxt(i).MultiLine = True '<===== cannot be set at run-time 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at run-time wndTxt(i).Visible = True top = top + wndTxt(i).Height + 10 i = i + 1 Loop End Sub
|
Tue, 18 Nov 2003 07:12:39 GMT |
|
 |
Sean T. Klei #2 / 10
|
 textbox control multiline property at run-time
Hello all, This is my first post to this list so please bear with me if I reveal my newbie status. In my app I am creating a control array of textboxes at run-time. I need to be able to set the multiline property to true but that property is read only at run-time. Does anyone know of a workaround for this? Any help is greatly appreciated. Sean --------------------------------- Code: Private Sub txtBoxLayout() Dim top As Integer Dim wndTxt(100) As TextBox top = 10 i = 0 Do While i < gCount ' dynamically create a text box for each image selected Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, Picture2) wndTxt(i).top = top wndTxt(i).Width = 320 wndTxt(i).Height = 240 'wndTxt(i).MultiLine = True '<===== cannot be set at run-time 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at run-time wndTxt(i).Visible = True top = top + wndTxt(i).Height + 10 i = i + 1 Loop End Sub
|
Tue, 18 Nov 2003 07:11:17 GMT |
|
 |
dnage #3 / 10
|
 textbox control multiline property at run-time
Maybe a better place to start is ... Why do you want to change it at runtime? Whats the reason you need a non-multi-line textbox? D?
Quote: > Hello all, This is my first post to this list so please bear with me if I > reveal my newbie status. > In my app I am creating a control array of textboxes at run-time. I need to > be able to set the multiline property to true but that property is read only > at run-time. Does anyone know of a workaround for this? Any help is greatly > appreciated. > Sean > --------------------------------- > Code: > Private Sub txtBoxLayout() > Dim top As Integer > Dim wndTxt(100) As TextBox > top = 10 > i = 0 > Do While i < gCount > ' dynamically create a text box for each image selected > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, Picture2) > wndTxt(i).top = top > wndTxt(i).Width = 320 > wndTxt(i).Height = 240 > 'wndTxt(i).MultiLine = True '<===== cannot be set at run-time > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at run-time > wndTxt(i).Visible = True > top = top + wndTxt(i).Height + 10 > i = i + 1 > Loop > End Sub
|
Tue, 18 Nov 2003 07:47:02 GMT |
|
 |
Sean T. Klei #4 / 10
|
 textbox control multiline property at run-time
Actually I do need a multi-line text box. I'm building a data entry form that allows the user to write a caption to an image acquired from a digital camera. The user selects the all of the pictures that they want to write a caption for and I dynamically build a data-entry form with a picturebox and a textbox for each image they selected from a fileList. For example, a user selects 8 images to "catalog". The form is generated with 8 pictureBoxes (each with one of the images selected), and 8 textBoxes (for the user to write a caption relevant to that image). The problem is I need to allow for 250 chars in the textBox and that means multi-line. I suppose I could limit the number of images that a user could select and just build a static form with that many pictureBoxes and TextBoxes but I'm looking for something a little more user friendly. Thanks.
Quote: > Maybe a better place to start is ... Why do you want to change it at > runtime? > Whats the reason you need a non-multi-line textbox? > D?
> > Hello all, This is my first post to this list so please bear with me if I > > reveal my newbie status. > > In my app I am creating a control array of textboxes at run-time. I need > to > > be able to set the multiline property to true but that property is read > only > > at run-time. Does anyone know of a workaround for this? Any help is > greatly > > appreciated. > > Sean > > --------------------------------- > > Code: > > Private Sub txtBoxLayout() > > Dim top As Integer > > Dim wndTxt(100) As TextBox > > top = 10 > > i = 0 > > Do While i < gCount > > ' dynamically create a text box for each image selected > > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, Picture2) > > wndTxt(i).top = top > > wndTxt(i).Width = 320 > > wndTxt(i).Height = 240 > > 'wndTxt(i).MultiLine = True '<===== cannot be set at run-time > > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at run-time > > wndTxt(i).Visible = True > > top = top + wndTxt(i).Height + 10 > > i = i + 1 > > Loop > > End Sub
|
Tue, 18 Nov 2003 08:05:03 GMT |
|
 |
dnage #5 / 10
|
 textbox control multiline property at run-time
This sounds do-able so far, but why change back to a single line text box? Are you trying to make the text fit across the picture in one line? (confuse)D?
Quote: > Actually I do need a multi-line text box. I'm building a data entry form > that allows the user to write a caption to an image acquired from a digital > camera. The user selects the all of the pictures that they want to write a > caption for and I dynamically build a data-entry form with a picturebox and > a textbox for each image they selected from a fileList. For example, a user > selects 8 images to "catalog". The form is generated with 8 pictureBoxes > (each with one of the images selected), and 8 textBoxes (for the user to > write a caption relevant to that image). The problem is I need to allow for > 250 chars in the textBox and that means multi-line. > I suppose I could limit the number of images that a user could select and > just build a static form with that many pictureBoxes and TextBoxes but I'm > looking for something a little more user friendly. > Thanks.
> > Maybe a better place to start is ... Why do you want to change it at > > runtime? > > Whats the reason you need a non-multi-line textbox? > > D?
> > > Hello all, This is my first post to this list so please bear with me if > I > > > reveal my newbie status. > > > In my app I am creating a control array of textboxes at run-time. I need > > to > > > be able to set the multiline property to true but that property is read > > only > > > at run-time. Does anyone know of a workaround for this? Any help is > > greatly > > > appreciated. > > > Sean > > > --------------------------------- > > > Code: > > > Private Sub txtBoxLayout() > > > Dim top As Integer > > > Dim wndTxt(100) As TextBox > > > top = 10 > > > i = 0 > > > Do While i < gCount > > > ' dynamically create a text box for each image selected > > > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, Picture2) > > > wndTxt(i).top = top > > > wndTxt(i).Width = 320 > > > wndTxt(i).Height = 240 > > > 'wndTxt(i).MultiLine = True '<===== cannot be set at run-time > > > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at run-time > > > wndTxt(i).Visible = True > > > top = top + wndTxt(i).Height + 10 > > > i = i + 1 > > > Loop > > > End Sub
|
Tue, 18 Nov 2003 08:14:30 GMT |
|
 |
Sean T. Klei #6 / 10
|
 textbox control multiline property at run-time
Now I'm confused. I don't want a single line text box. Is there something I have to specify in the Controls.Add method to make it a multi-line? I want a multi-line, scrollable, word-wrapping text box. I have the line in the code: 'wndTxt(i).MultiLine = True commented out because it returns a 'read-only at run-time error'
Quote: > This sounds do-able so far, but why change back to a single line text box? > Are you trying to make the text fit across the picture in one line? > (confuse)D?
> > Actually I do need a multi-line text box. I'm building a data entry form > > that allows the user to write a caption to an image acquired from a > digital > > camera. The user selects the all of the pictures that they want to write a > > caption for and I dynamically build a data-entry form with a picturebox > and > > a textbox for each image they selected from a fileList. For example, a > user > > selects 8 images to "catalog". The form is generated with 8 pictureBoxes > > (each with one of the images selected), and 8 textBoxes (for the user to > > write a caption relevant to that image). The problem is I need to allow > for > > 250 chars in the textBox and that means multi-line. > > I suppose I could limit the number of images that a user could select and > > just build a static form with that many pictureBoxes and TextBoxes but I'm > > looking for something a little more user friendly. > > Thanks.
> > > Maybe a better place to start is ... Why do you want to change it at > > > runtime? > > > Whats the reason you need a non-multi-line textbox? > > > D?
> > > > Hello all, This is my first post to this list so please bear with me > if > > I > > > > reveal my newbie status. > > > > In my app I am creating a control array of textboxes at run-time. I > need > > > to > > > > be able to set the multiline property to true but that property is > read > > > only > > > > at run-time. Does anyone know of a workaround for this? Any help is > > > greatly > > > > appreciated. > > > > Sean > > > > --------------------------------- > > > > Code: > > > > Private Sub txtBoxLayout() > > > > Dim top As Integer > > > > Dim wndTxt(100) As TextBox > > > > top = 10 > > > > i = 0 > > > > Do While i < gCount > > > > ' dynamically create a text box for each image selected > > > > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, Picture2) > > > > wndTxt(i).top = top > > > > wndTxt(i).Width = 320 > > > > wndTxt(i).Height = 240 > > > > 'wndTxt(i).MultiLine = True '<===== cannot be set at run-time > > > > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at > run-time > > > > wndTxt(i).Visible = True > > > > top = top + wndTxt(i).Height + 10 > > > > i = i + 1 > > > > Loop > > > > End Sub
|
Tue, 18 Nov 2003 08:21:05 GMT |
|
 |
dnage #7 / 10
|
 textbox control multiline property at run-time
Thats simple enough to answer, set the property at design time from the properties window. Thats the only way to do it without sub-classing the text box. In your initial post, it sounded like you had a need to have a single line TextBox so thats why I persisted with my questions... Its a design time only property (unless you want to re-use someones code to subclass it and that brings other problems into scope...) D.
Quote: > Now I'm confused. I don't want a single line text box. Is there something I > have to specify in the Controls.Add method to make it a multi-line? I want > a multi-line, scrollable, word-wrapping text box. > I have the line in the code: > 'wndTxt(i).MultiLine = True > commented out because it returns a 'read-only at run-time error'
> > This sounds do-able so far, but why change back to a single line text box? > > Are you trying to make the text fit across the picture in one line? > > (confuse)D?
> > > Actually I do need a multi-line text box. I'm building a data entry > form > > > that allows the user to write a caption to an image acquired from a > > digital > > > camera. The user selects the all of the pictures that they want to write > a > > > caption for and I dynamically build a data-entry form with a picturebox > > and > > > a textbox for each image they selected from a fileList. For example, a > > user > > > selects 8 images to "catalog". The form is generated with 8 pictureBoxes > > > (each with one of the images selected), and 8 textBoxes (for the user to > > > write a caption relevant to that image). The problem is I need to allow > > for > > > 250 chars in the textBox and that means multi-line. > > > I suppose I could limit the number of images that a user could select > and > > > just build a static form with that many pictureBoxes and TextBoxes but > I'm > > > looking for something a little more user friendly. > > > Thanks.
> > > > Maybe a better place to start is ... Why do you want to change it at > > > > runtime? > > > > Whats the reason you need a non-multi-line textbox? > > > > D?
> > > > > Hello all, This is my first post to this list so please bear with me > > if > > > I > > > > > reveal my newbie status. > > > > > In my app I am creating a control array of textboxes at run-time. I > > need > > > > to > > > > > be able to set the multiline property to true but that property is > > read > > > > only > > > > > at run-time. Does anyone know of a workaround for this? Any help is > > > > greatly > > > > > appreciated. > > > > > Sean > > > > > --------------------------------- > > > > > Code: > > > > > Private Sub txtBoxLayout() > > > > > Dim top As Integer > > > > > Dim wndTxt(100) As TextBox > > > > > top = 10 > > > > > i = 0 > > > > > Do While i < gCount > > > > > ' dynamically create a text box for each image selected > > > > > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, > Picture2) > > > > > wndTxt(i).top = top > > > > > wndTxt(i).Width = 320 > > > > > wndTxt(i).Height = 240 > > > > > 'wndTxt(i).MultiLine = True '<===== cannot be set at > run-time > > > > > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at > > run-time > > > > > wndTxt(i).Visible = True > > > > > top = top + wndTxt(i).Height + 10 > > > > > i = i + 1 > > > > > Loop > > > > > End Sub
|
Tue, 18 Nov 2003 08:42:14 GMT |
|
 |
Sean T. Klei #8 / 10
|
 textbox control multiline property at run-time
Thanks, I was trying to avoid adding the control at design-time. In the original code the text boxes were created in run-time using the Control.Add method. That way I could create a control for each image selected -no more, no less. Because the control didn't exist until run-time, I couldn't set the design-time properties. What I ended up doing what you advised. I just created an array of 20 text boxes in design-time and only use the ones that I need in run-time. The rest remain invisible. I was trying to avoid this as it puts a theoretical limit on the number of images a user can select at one time (currently 20) but that just me being a perfectionist. Thanks for all of your help, -Sean
Quote: > Thats simple enough to answer, set the property at design time > from the properties window. Thats the only way to do it without > sub-classing the text box. > In your initial post, it sounded like you had a need to have a single > line TextBox so thats why I persisted with my questions... > Its a design time only property (unless you want to re-use someones > code to subclass it and that brings other problems into scope...) > D.
> > Now I'm confused. I don't want a single line text box. Is there something > I > > have to specify in the Controls.Add method to make it a multi-line? I > want > > a multi-line, scrollable, word-wrapping text box. > > I have the line in the code: > > 'wndTxt(i).MultiLine = True > > commented out because it returns a 'read-only at run-time error'
> > > This sounds do-able so far, but why change back to a single line text > box? > > > Are you trying to make the text fit across the picture in one line? > > > (confuse)D?
> > > > Actually I do need a multi-line text box. I'm building a data entry > > form > > > > that allows the user to write a caption to an image acquired from a > > > digital > > > > camera. The user selects the all of the pictures that they want to > write > > a > > > > caption for and I dynamically build a data-entry form with a > picturebox > > > and > > > > a textbox for each image they selected from a fileList. For example, > a > > > user > > > > selects 8 images to "catalog". The form is generated with 8 > pictureBoxes > > > > (each with one of the images selected), and 8 textBoxes (for the user > to > > > > write a caption relevant to that image). The problem is I need to > allow > > > for > > > > 250 chars in the textBox and that means multi-line. > > > > I suppose I could limit the number of images that a user could select > > and > > > > just build a static form with that many pictureBoxes and TextBoxes but > > I'm > > > > looking for something a little more user friendly. > > > > Thanks.
> > > > > Maybe a better place to start is ... Why do you want to change it at > > > > > runtime? > > > > > Whats the reason you need a non-multi-line textbox? > > > > > D?
> > > > > > Hello all, This is my first post to this list so please bear with > me > > > if > > > > I > > > > > > reveal my newbie status. > > > > > > In my app I am creating a control array of textboxes at run-time. > I > > > need > > > > > to > > > > > > be able to set the multiline property to true but that property is > > > read > > > > > only > > > > > > at run-time. Does anyone know of a workaround for this? Any help > is > > > > > greatly > > > > > > appreciated. > > > > > > Sean > > > > > > --------------------------------- > > > > > > Code: > > > > > > Private Sub txtBoxLayout() > > > > > > Dim top As Integer > > > > > > Dim wndTxt(100) As TextBox > > > > > > top = 10 > > > > > > i = 0 > > > > > > Do While i < gCount > > > > > > ' dynamically create a text box for each image selected > > > > > > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, > > Picture2) > > > > > > wndTxt(i).top = top > > > > > > wndTxt(i).Width = 320 > > > > > > wndTxt(i).Height = 240 > > > > > > 'wndTxt(i).MultiLine = True '<===== cannot be set at > > run-time > > > > > > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at > > > run-time > > > > > > wndTxt(i).Visible = True > > > > > > top = top + wndTxt(i).Height + 10 > > > > > > i = i + 1 > > > > > > Loop > > > > > > End Sub
|
Tue, 18 Nov 2003 09:36:41 GMT |
|
 |
Randy Birc #9 / 10
|
 textbox control multiline property at run-time
If you place one textbox on the form, set its index property to 0, set any design-time properties you want, you can create as many additional "clones" of that textbox using the Load method. Your only limitation is that you can never unload the initial design-time control. This can also be done for the image controls you use for the pictures, and by doing so the index of each image control will match the text control, making life even easier. One point -- after using Load and positioning the new control, you have to set the visible property to True to see it. -- Randy Birch MVP Visual Basic http://www.mvps.org/vbnet/ Please respond only to the newsgroups so all can benefit.
: Thanks, : : I was trying to avoid adding the control at design-time. In the original : code the text boxes were created in run-time using the Control.Add method. : That way I could create a control for each image selected -no more, no less. : Because the control didn't exist until run-time, I couldn't set the : design-time properties. What I ended up doing what you advised. I just : created an array of 20 text boxes in design-time and only use the ones that : I need in run-time. The rest remain invisible. I was trying to avoid this : as it puts a theoretical limit on the number of images a user can select at : one time (currently 20) but that just me being a perfectionist. : : Thanks for all of your help, : : -Sean : :
: > Thats simple enough to answer, set the property at design time : > from the properties window. Thats the only way to do it without : > sub-classing the text box. : > : > In your initial post, it sounded like you had a need to have a single : > line TextBox so thats why I persisted with my questions... : > : > Its a design time only property (unless you want to re-use someones : > code to subclass it and that brings other problems into scope...) : > : > D. : >
: > > Now I'm confused. I don't want a single line text box. Is there : something : > I : > > have to specify in the Controls.Add method to make it a multi-line? I : > want : > > a multi-line, scrollable, word-wrapping text box. : > > : > > I have the line in the code: : > > 'wndTxt(i).MultiLine = True : > > commented out because it returns a 'read-only at run-time error' : > >
: > > > This sounds do-able so far, but why change back to a single line text : > box? : > > > : > > > Are you trying to make the text fit across the picture in one line? : > > > : > > > (confuse)D? : > > >
: > > > > Actually I do need a multi-line text box. I'm building a data entry : > > form : > > > > that allows the user to write a caption to an image acquired from a : > > > digital : > > > > camera. The user selects the all of the pictures that they want to : > write : > > a : > > > > caption for and I dynamically build a data-entry form with a : > picturebox : > > > and : > > > > a textbox for each image they selected from a fileList. For : example, : > a : > > > user : > > > > selects 8 images to "catalog". The form is generated with 8 : > pictureBoxes : > > > > (each with one of the images selected), and 8 textBoxes (for the : user : > to : > > > > write a caption relevant to that image). The problem is I need to : > allow : > > > for : > > > > 250 chars in the textBox and that means multi-line. : > > > > : > > > > I suppose I could limit the number of images that a user could : select : > > and : > > > > just build a static form with that many pictureBoxes and TextBoxes : but : > > I'm : > > > > looking for something a little more user friendly. : > > > > : > > > > Thanks. : > > > >
: > > > > > Maybe a better place to start is ... Why do you want to change it : at : > > > > > runtime? : > > > > > Whats the reason you need a non-multi-line textbox? : > > > > > : > > > > > D? : > > > > >
: > > > > > > Hello all, This is my first post to this list so please bear : with : > me : > > > if : > > > > I : > > > > > > reveal my newbie status. : > > > > > > : > > > > > > In my app I am creating a control array of textboxes at : run-time. : > I : > > > need : > > > > > to : > > > > > > be able to set the multiline property to true but that property : is : > > > read : > > > > > only : > > > > > > at run-time. Does anyone know of a workaround for this? Any help : > is : > > > > > greatly : > > > > > > appreciated. : > > > > > > : > > > > > > Sean : > > > > > > --------------------------------- : > > > > > > Code: : > > > > > > : > > > > > > Private Sub txtBoxLayout() : > > > > > > Dim top As Integer : > > > > > > Dim wndTxt(100) As TextBox : > > > > > > top = 10 : > > > > > > i = 0 : > > > > > > Do While i < gCount : > > > > > > : > > > > > > ' dynamically create a text box for each image selected : > > > > > > : > > > > > > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, : > > Picture2) : > > > > > > wndTxt(i).top = top : > > > > > > wndTxt(i).Width = 320 : > > > > > > wndTxt(i).Height = 240 : > > > > > > 'wndTxt(i).MultiLine = True '<===== cannot be set at : > > run-time : > > > > > > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set at : > > > run-time : > > > > > > wndTxt(i).Visible = True : > > > > > > : > > > > > > top = top + wndTxt(i).Height + 10 : > > > > > > i = i + 1 : > > > > > > Loop : > > > > > > End Sub : > > > > > > : > > > > > > : > > > > > > : > > > > > > : > > > > > > : > > > > > : > > > > > : > > > > : > > > > : > > > : > > > : > > : > > : > : > : :
|
Tue, 18 Nov 2003 12:59:43 GMT |
|
 |
Sean T. Klei #10 / 10
|
 textbox control multiline property at run-time
Exactly what I need. Thank you very much.
Quote: > If you place one textbox on the form, set its index property to 0, set any > design-time properties you want, you can create as many additional "clones" > of that textbox using the Load method. Your only limitation is that you can > never unload the initial design-time control. This can also be done for the > image controls you use for the pictures, and by doing so the index of each > image control will match the text control, making life even easier. One > point -- after using Load and positioning the new control, you have to set > the visible property to True to see it. > -- > Randy Birch > MVP Visual Basic > http://www.mvps.org/vbnet/ > Please respond only to the newsgroups so all can benefit.
> : Thanks, > : > : I was trying to avoid adding the control at design-time. In the original > : code the text boxes were created in run-time using the Control.Add method. > : That way I could create a control for each image selected -no more, no > less. > : Because the control didn't exist until run-time, I couldn't set the > : design-time properties. What I ended up doing what you advised. I just > : created an array of 20 text boxes in design-time and only use the ones > that > : I need in run-time. The rest remain invisible. I was trying to avoid this > : as it puts a theoretical limit on the number of images a user can select > at > : one time (currently 20) but that just me being a perfectionist. > : > : Thanks for all of your help, > : > : -Sean > : > :
> : > Thats simple enough to answer, set the property at design time > : > from the properties window. Thats the only way to do it without > : > sub-classing the text box. > : > > : > In your initial post, it sounded like you had a need to have a single > : > line TextBox so thats why I persisted with my questions... > : > > : > Its a design time only property (unless you want to re-use someones > : > code to subclass it and that brings other problems into scope...) > : > > : > D. > : >
> : > > Now I'm confused. I don't want a single line text box. Is there > : something > : > I > : > > have to specify in the Controls.Add method to make it a multi-line? I > : > want > : > > a multi-line, scrollable, word-wrapping text box. > : > > > : > > I have the line in the code: > : > > 'wndTxt(i).MultiLine = True > : > > commented out because it returns a 'read-only at run-time error' > : > >
> : > > > This sounds do-able so far, but why change back to a single line > text > : > box? > : > > > > : > > > Are you trying to make the text fit across the picture in one line? > : > > > > : > > > (confuse)D? > : > > >
> : > > > > Actually I do need a multi-line text box. I'm building a data > entry > : > > form > : > > > > that allows the user to write a caption to an image acquired from > a > : > > > digital > : > > > > camera. The user selects the all of the pictures that they want to > : > write > : > > a > : > > > > caption for and I dynamically build a data-entry form with a > : > picturebox > : > > > and > : > > > > a textbox for each image they selected from a fileList. For > : example, > : > a > : > > > user > : > > > > selects 8 images to "catalog". The form is generated with 8 > : > pictureBoxes > : > > > > (each with one of the images selected), and 8 textBoxes (for the > : user > : > to > : > > > > write a caption relevant to that image). The problem is I need to > : > allow > : > > > for > : > > > > 250 chars in the textBox and that means multi-line. > : > > > > > : > > > > I suppose I could limit the number of images that a user could > : select > : > > and > : > > > > just build a static form with that many pictureBoxes and TextBoxes > : but > : > > I'm > : > > > > looking for something a little more user friendly. > : > > > > > : > > > > Thanks. > : > > > >
> : > > > > > Maybe a better place to start is ... Why do you want to change > it > : at > : > > > > > runtime? > : > > > > > Whats the reason you need a non-multi-line textbox? > : > > > > > > : > > > > > D? > : > > > > >
> : > > > > > > Hello all, This is my first post to this list so please bear > : with > : > me > : > > > if > : > > > > I > : > > > > > > reveal my newbie status. > : > > > > > > > : > > > > > > In my app I am creating a control array of textboxes at > : run-time. > : > I > : > > > need > : > > > > > to > : > > > > > > be able to set the multiline property to true but that > property > : is > : > > > read > : > > > > > only > : > > > > > > at run-time. Does anyone know of a workaround for this? Any > help > : > is > : > > > > > greatly > : > > > > > > appreciated. > : > > > > > > > : > > > > > > Sean > : > > > > > > --------------------------------- > : > > > > > > Code: > : > > > > > > > : > > > > > > Private Sub txtBoxLayout() > : > > > > > > Dim top As Integer > : > > > > > > Dim wndTxt(100) As TextBox > : > > > > > > top = 10 > : > > > > > > i = 0 > : > > > > > > Do While i < gCount > : > > > > > > > : > > > > > > ' dynamically create a text box for each image selected > : > > > > > > > : > > > > > > Set wndTxt(i) = Controls.Add("VB.TextBox", "wndTxt" & i, > : > > Picture2) > : > > > > > > wndTxt(i).top = top > : > > > > > > wndTxt(i).Width = 320 > : > > > > > > wndTxt(i).Height = 240 > : > > > > > > 'wndTxt(i).MultiLine = True '<===== cannot be set at > : > > run-time > : > > > > > > 'wndTxt(i).ScrollBars = vbVertical '<===== cannot be set > at > : > > > run-time > : > > > > > > wndTxt(i).Visible = True > : > > > > > > > : > > > > > > top = top + wndTxt(i).Height + 10 > : > > > > > > i = i + 1 > : > > > > > > Loop > : > > > > > > End Sub > : > > > > > > > : > > > > > > > : > > > > > > > : > > > > > > > : > > > > > > > : > > > > > > : > > > > > > : > > > > > : > > > > > : > > > > : > > > > : > > > : > > > : > > : > > : > :
|
Tue, 18 Nov 2003 17:22:10 GMT |
|
|
|