Home > Software engineering >  Vb6 how to multiple event information into a textBox
Vb6 how to multiple event information into a textBox

Time:09-19

In turn, click on each button will return to information on the test information for each button box thank you all for the great god

CodePudding user response:

Suppose you output "test information" of the text box for Text1

The simple approach:
In each event "button", execute a: Text1. Text=Text1. Text & amp; Returns text & amp; VbCrLf

Pay attention to two questions:
1. The contents of the TextBox length is limited, can display at most about 32768 characters (carriage return, newline, is two characters, also included)
2. The text content is large, can have the feeling of caton,

To tackle the problem of "caton can use a string variable to store the module level display content, such as variable called strMsg,
Write in the Form_Load, strMsg=""
Then, each "button events", write down the two words:
StrMsg=strMsg & amp; Returns text & amp; VbCrLf
Text1. Text strMsg=
This kind of treatment, "caton" problem will be improved significantly,

In fact, if you want to show a lot of content, use the ListView control to display more appropriate,
One is the "capacity" need not consider, as long as your computer's memory is large enough (of course the most "effective" for 4 gb),
More than 2 gb of memory almost don't have to worry about "memory",
2 it is not "caton" problem, record the millions, tens of millions of messages, to record a few messages, almost no difference,
Note here refers to "a button to add 1 or few messages" under the premise of
If it is a "one-time added:" if the method is undeserved, with tens of thousands of dozens of article, there will be "different",

CodePudding user response:

Just contact with VB6, the original poster is most likely there is a problem may still don't know the building Lord:
"Output" of the text box, you must keep it MultiLine property is set to True,
This can only be in the form design changes in the properties window ", can change to the code used in running,

The MultiLine is set to True, then it's ScrollBars properties, instead of 2 (has a vertical scroll bar, because you will have a "many lines of" information),
If every message content more, can be set to 3 (horizontal, vertical scroll bar),

VB6 text box, the default is "single", even if you pull control is very high, there are + newline in the text, it also will show only 1 line of text,
And truncated from the first "of" carriage returns, and the content behind the "disappeared" (only on the vision disappeared, Text attribute or complete),

CodePudding user response:

Institute of technology of profession of VB6 visual programming (wuxi) http://download.csdn.net/detail/zhao4zhong1/6824713

CodePudding user response:

Thank you solved it was yesterday I just contact thank you very much

CodePudding user response:

reference 1st floor Chen8013 response:
suppose you output "test information" of the text box for Text1

The simple approach:
In each event "button", execute a: Text1. Text=Text1. Text & amp; Returns text & amp; VbCrLf

Pay attention to two questions:
1. The contents of the TextBox length is limited, can display at most about 32768 characters (carriage return, newline, is two characters, also included)
2. The text content is large, can have the feeling of caton,

To tackle the problem of "caton can use a string variable to store the module level display content, such as variable called strMsg,
Write in the Form_Load, strMsg=""
Then, each "button events", write down the two words:
StrMsg=strMsg & amp; Returns text & amp; VbCrLf
Text1. Text strMsg=
This kind of treatment, "caton" problem will be improved significantly,

In fact, if you want to show a lot of content, use the ListView control to display more appropriate,
One is the "capacity" need not consider, as long as your computer's memory is large enough (of course the most "effective" for 4 gb),
More than 2 gb of memory almost don't have to worry about "memory",
2 it is not "caton" problem, record the millions, tens of millions of messages, to record a few messages, almost no difference,
Note here refers to "a button to add 1 or few messages" under the premise of
If it is a "one-time added:" if the method is undeserved, with tens of thousands of dozens of bars, there will be "different",
thank god
  • Related