Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2004, 07:34 AM
Authorized User
 
Join Date: Dec 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to set the multiline property at run time?

How to set the multiline property or ScrollBars of the text control at run time?
 
Old January 6th, 2004, 08:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

textbox.multiline=true

textbox.scrollbars=<value>
where <value> is vbSBNone, vbHorizontal, vbVertical, or vbBoth.

the multiline property must be true for you to set a value other than vbSBNone


Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old January 7th, 2004, 11:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

My response to this was in error. In VB6, both the multiline and scrollbars properties are read-only at run time, so they cannot be set.

The only way to do this, that I know of, is to create multiple textboxes, one for each combination of possible properties, and make the desired one visible and the others not visible at run time.

This is perhaps best encapsulated into a custom OCX.

Sorry for the error.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
 
Old January 9th, 2004, 03:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Scrollbars are added to the window at creation time, therefore it is not that easy to change the Multiline property at run time. BTW why do you need it? My advise is to load two texboxes, a normal and a multine, put them ot top of each other and hide/show (or zorder) the one you need at that moment)

Marco





Similar Threads
Thread Thread Starter Forum Replies Last Post
how set Attribute of Folder at Run Time Rahul Gupta Pro VB 6 2 October 17th, 2007 11:55 PM
max length property of multiline text box MunishBhatia ASP.NET 2.0 Professional 5 June 14th, 2007 01:55 AM
Get Set Property value being lost asn187 ASP.NET 2.0 Professional 1 April 19th, 2007 03:09 PM
Set AdoDc properties at run time Psionman Pro VB Databases 2 November 10th, 2004 10:07 AM
DataGrid DataColumn Property Set at Run-time karhodes ADO.NET 0 April 14th, 2004 03:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.