textbox control multiline property at run-time 
Author Message
 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  
 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  
 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  
 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  
 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  
 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  
 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  
 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  
 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  
 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  
 
 [ 10 post ] 

 Relevant Pages 

1. Adding Multiline TextBox at Run Time

2. Setting Multiline property on textbox control array.

3. Custom control with property like Listbox and textbox (multiline)

4. Saving properties of ActiveX control from design time to run time

5. TextBox .BorderStyle property at run-time

6. Design-time properties in Run-time Controls

7. creating a *multiline* textbox at runtime ?

8. multiline textbox at runtime

9. creating textbox and combobox controls at run-time

10. Resize controls (labels or textboxes) during run-time

11. Multiline at run time

12. Create Multiline Text Box at Run Time

 

 
Powered by phpBB® Forum Software