Problem VB6.TextBox
7 отговора
190 прегледа
Problem VB6.TextBox
zna4i opitvam se da pokaja file v textbox, no ako fileto e pove4e ot 32K, go raje. v msdn pishe, 4e ako zadam MaxLength=0, dyljinata e neograni4ena ako MultiLine=False. No ako MultiLine=True - okolo (zabelejete "okolo") 32K !?
Znae li niakoi kak da se sboria? Drug kontrol ili neshto podobno. Tova pokazvane e malko v strani ot osnovnte funkcii na prilojenieto i ne mi se pishe mnogo code za da 4eta fileto na 4asti i taka...
shte kopna i kakvo kazva msdn
*****************************************************************
MaxLength Property
Returns or sets a value indicating whether there is a maximum number of characters that can be entered in the TextBox control and, if so, specifies the maximum number of characters that can be entered.
Note In DBCS (double-byte character set) systems, each character can take up to two bytes instead of only one, which limits the number of characters you can enter.
Syntax
object.MaxLength [= value]
The MaxLength property syntax has these parts:
Part Description
object Anobject expression that evaluates to an object in the Applies To list.
value An integer specifying the maximum number of characters a user can enter in a TextBox control. The default for the MaxLength property is 0, indicating no maximum other than that created by memory constraints on the user's system for single-line TextBox controls and a maximum of approximately 32K for multiple-line TextBox controls. Any number greater than 0 indicates the maximum number of characters.
Remarks
Use the MaxLength property to limit the number of characters a user can enter in a TextBox.
If text that exceeds the MaxLength property setting is assigned to a TextBox from code, no error occurs; however, only the maximum number of characters is assigned to the Text property, and extra characters are truncated. Changing this property doesn't affect the current contents of a TextBox but will affect any subsequent changes to the contents.
*****************************************************************
Znae li niakoi kak da se sboria? Drug kontrol ili neshto podobno. Tova pokazvane e malko v strani ot osnovnte funkcii na prilojenieto i ne mi se pishe mnogo code za da 4eta fileto na 4asti i taka...
shte kopna i kakvo kazva msdn
*****************************************************************
MaxLength Property
Returns or sets a value indicating whether there is a maximum number of characters that can be entered in the TextBox control and, if so, specifies the maximum number of characters that can be entered.
Note In DBCS (double-byte character set) systems, each character can take up to two bytes instead of only one, which limits the number of characters you can enter.
Syntax
object.MaxLength [= value]
The MaxLength property syntax has these parts:
Part Description
object Anobject expression that evaluates to an object in the Applies To list.
value An integer specifying the maximum number of characters a user can enter in a TextBox control. The default for the MaxLength property is 0, indicating no maximum other than that created by memory constraints on the user's system for single-line TextBox controls and a maximum of approximately 32K for multiple-line TextBox controls. Any number greater than 0 indicates the maximum number of characters.
Remarks
Use the MaxLength property to limit the number of characters a user can enter in a TextBox.
If text that exceeds the MaxLength property setting is assigned to a TextBox from code, no error occurs; however, only the maximum number of characters is assigned to the Text property, and extra characters are truncated. Changing this property doesn't affect the current contents of a TextBox but will affect any subsequent changes to the contents.
*****************************************************************
Re: Problem VB6.TextBox
Обикновения TextBox си има ограничение до 64к, но си зависи и какъв текст му изсипваш.
За да вдигнеш ограничението до "около" 2 гигабайта - ползвай RichTextBox.
----------------------------------
помислих, хареса ми, помислих пак...
За да вдигнеш ограничението до "около" 2 гигабайта - ползвай RichTextBox.
----------------------------------
помислих, хареса ми, помислих пак...
Re: Problem VB6.TextBox
v win 9x ima ogranichenie za razmer na texta v textbox, richtext naistina shte pomogne
Re: Problem VB6.TextBox
TextBox-а е достабъгава контрола. Единият и най-фрапиращ бъг който сме хващали е с Locked property-то. Когато е то включено по принцип не трабва да може да се пише текст в контролата. Е да се пише не може но може да се Paste-не :))).
Вторият бъг (който не е сигурно че е точно бъг) е със Alignment property-то. При промяната му Visual Basic УНИЩОЖАВА съответният прозирец на контролата и я създава отново. При създаването на новият прозорец текста се инициализира на текста в Designe Time и след това се сетва на текста какъвто е бил преди промяна на Alignment property-то. И при това се вика Change Event-a. Абе красота просто.
Така че ако имате да правите форма с повече контроли по добре не ползвайте вградената Text контрола!!!
Боже колко мъка има на този свят Боже!



Вторият бъг (който не е сигурно че е точно бъг) е със Alignment property-то. При промяната му Visual Basic УНИЩОЖАВА съответният прозирец на контролата и я създава отново. При създаването на новият прозорец текста се инициализира на текста в Designe Time и след това се сетва на текста какъвто е бил преди промяна на Alignment property-то. И при това се вика Change Event-a. Абе красота просто.
Така че ако имате да правите форма с повече контроли по добре не ползвайте вградената Text контрола!!!
Боже колко мъка има на този свят Боже!
Re: Problem VB6.TextBox
Да с RichTextBox стана. А това с Paste Мислиа, 4е мойе да се избегне ако се прихващат клажисхите и кликаниата.
Ако Lucked=True, може да се променя съдържанието: Text1.Text=strAlaBala
Ако Lucked=True, може да се променя съдържанието: Text1.Text=strAlaBala
Re: Problem VB6.TextBox
ще стане, но цвета ще е поизбледниал :)
ина4е това е маи най-доброто решение без да се пише код...
ина4е това е маи най-доброто решение без да се пише код...