Thas right, that's my question. Is the nº of characters limited on a InputBox?
In my application I want to put (or should I say Input?) a large sentence but it not allows me to do so.
I don't know what the input limit is in an InputBox, but I believe it's 32,767 characters in a textbox. I have a form that looks like an InputBox that uses a textbox for the input. If you're interested I'll attach it.
I will try to use it instead of a normal InputBox. Later I will tell you the results.
By the way, one newbie question: whats that InputBox.frx? When I tried to open it, it started Visual FoxPro. What's its function regarding the InputBox.frm?
Some controls have properties that have binary data as their values, such as the Picture property of picture box and image controls or certain properties of custom controls. Visual Basic saves all binary data for a form in a binary data file separate from the form.
Visual Basic saves the binary data file in the same directory as the form. The binary data file has the same file name as the form, but it has an .frx filename extension. Visual Basic reads the binary data file when loading the form. The binary data file (.frx) must be available to the form when Visual Basic loads it. If you share forms with others that use a binary data file, be sure to provide the binary data file (.frx) as well as the form (.frm).
Your explanation was very helpfull. Since I´ve started using VB that I see those *.frx files and never new the purpose of their existance. Now I know. Allways learnning.
On cmdButton of frmInputBox.frm I´ve added the following code (My code is between those two »):
Private Sub cmdButton_Click(Index As Integer)
Select Case Index
Case btnOK
ButtonClicked = vbOK
Case btnCancel
ButtonClicked = vbCancel
End Select
»
If btnOK = 1 Then
txtInput.Text = Form2.Text1.Text
End If
»
Me.Hide
Form2.Show
End Sub
This must not be 100 % correct 'cause I can .Show Form2 but nothing appears on Form2's TextBox.
It do not work that way. Now I've noticed one thing. The text that I want to "input" can not be a property because the user can put there everything he wants. So, I can not say txtInput.Text.
Therefore, must be a variable.
The problem is that I can not find where is it declared.
By the way: what's the difference between txtInput.Text = Form2.Text1.Text and Form2.Text1.Text = txtInput.Text?
According with the author of this project, Form1 (frmInputBox) should act like an InputBox (at least I understood it that way).
Then I've added a Form2 (with a TextBox) to the project.
So, I want to input text on the InputBox (frmInputBox) and make it appear on Form2.TextBox.
The property Text of txtInput (on frmInputBox) is something that is constant until you change it in the code and, as you know, you can not change it by simply writting inside the TexBox.
So, the property Text on frmInputBox's Text Box must be a variable (I think). I can not find any variable declaration for it so that I can use it to make Form2.Text1.Text = ????
Yes, it eliminates the problem that stared this thread: the limit on the nº of characters of an InputBox.
I had some difficulties to put it working, as you can see by my "dialog" with Illspirit but, at the end, everything works fine.
There's only a "but": I didn't understood the relation between
Public Property Get ButtonClicked() As Integer
ButtonClicked = m_intButtonClicked
End Property
and
Private Property Let ButtonClicked(ByVal intButton As Integer)
m_intButtonClicked = intButton
End Property
Why is this needed? Why can't we work only with ButtonClicked = vbOK?
Sorry about this question but I really need some answers.
ButtonClicked is one of several properties that I added to the form to make it easy to work with. Here is the list which appears in the form's declaration section.
Code:
' To use this form, you can access its objects directly or through the form's
' properties. The following are the properties
' frmInputBox.ButtonClicked ' Returns vbOK or vbCancel depending on the button clicked
' frmInputBox.Default ' Returns/sets the initial value for user input
' frmInputBox.Display ' Show the form modally
' frmInputBox.PasswordProtect ' Returns/sets whether characters typed by the user are protected
' by asterisks. (If this is set to True, it doesn't make sense
' to set the Default property.
' frmInputBox.Prompt ' Set the InputBox Prompt value
' frmInputBox.Title ' Set the InputBox Caption value
The purpose of the properties are to "hide" the working of a function of the form so that you don't have to worry about the details of how certain things are done and thereby make it easier to work with.
For example if you want to use my inputbox for the purpose of entering a password, it's a whole lot easier just to say frmInputBox.PasswordProtect = True then to remember that the name of the textbox object on the form is txtInput and to know that the way you password protect the entry of text in a texbox is by setting the textbox's PasswordChar to an asterisk.
As for your specific question about ButtonClicked, I'm not 100% sure what it is that you are asking. If you are confused about how property procedures work there is a lot of information in Help and/or there are a lot of good VB books that cover the subject. My ButtonClicked property has the Let (the place where the value is set) as Private so that you can't set the "hidden" m_intButtonClicked field directly, but has the Get (the place where you find out what the value is) as Public so that it's available to you by simply saying something like
Code:
If frmInputBox.ButtonClicked = vbCancel Then
MsgBox "Are you sure you want to cancel?"
End If
I think that you are right when you say that I'm confused about properties procedures. I've started to learn VB about one month ago and I think that, sometimes, I want to know more that I can at this moment.
I will study a little bit more so that I can understand my own doubts (in this case I feel that I cannot explain you my doubts because I'm confused about it)
Anyway, thanks a lot for you help. We'll meet again for sure.