Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 383. 'Text' property is readonly 1

Status
Not open for further replies.

mondi

Programmer
Sep 10, 2003
169
AL
Hello everybody!
I don't know why in an application I have this error 383. It says that the text property is readonly. It is just driving me crazy, I think this error happens in a richtextbox, but how can I avoid it? I am using Visual Basic 6 . This error didn't happen before, I am really surprised because it happens in every computer.
I would be very thankful for any answers

Country of eagles
 
Did you walk through the code and see where the error is occuring? The richtextbox's text property cannot be read only, even when it is locked, you can still write to the text property. It has to be another control.
-Max
 
it is .Text property. But my problem is that it used to work and I thought the project was finished, but now I have this error. I think this is a bug of Visual Studio 6. Can this error happen if any dll or lcx is missing?
Thanks for your answers.

Country of eagles
 
it is .Text proerty. However I thought the program was finished two months ago, and I even tested it, so I will find the code and test it from the beginning. Can this error happen because any dll or ocx is missing, because it is really strange that this error happened, it used to be OK.
Thanks guys for your answers

Country of eagles
 
Your richtextbox isn't perchance connected to a datasource, is it?
 
According to MSDN, Error 383 applies to "the Windows Common Controls located in the MSComctl.OCX file".

Are you absolutely sure it's a richtextbox that's causing the problem and not a combobox with its style set to "Dropdown List"?

Trevor
 
383 applies to a lot more than the Windows Common Controls; you'll have been too restrictive in your search
 
Thank you guys for all your answers, I will have a closer look to the source code, maybe it is a problem of any combo because I had several combos in these forms, but I had several combos in the other forms of the application too. However I am astonished because it used to work when I made the last build. Does any one know if this error might have to do with changing the country in the regional and language options in the control panel. Because with the combos I remind that I used to have some problems when changing the language from english (UK) to english (US).

Country of eagles
 
The problem was at a combo box as Trevor said. But I still can't understand why that should be a problem. I used the dropdown style in the other combos too, but they didn't give any problem. Even in the forms that had this exception I used some combos with the dropdown style, but they used to work fine. Should I be afraid to have this same problem with the other combos, because as I said above I didn't have this error before.
Thanks to all of you especially Trevor

Country of eagles
 
It's important to understand that the combo box control has one setting that makes it no longer a combo box. Combo box means that it combines the characteristics of a text box and a list box. When you set the style property to dropdown list, you no longer have the ability to write your own stuff in the top of the box. If you don't have a combo box, the text property is whatever the text of the currently selected line is. If you do, it's whatever is in the text box at the top of the list. (Just put a combo box in a form, and play with the style property. You should see clearly what's going on.) So, if at runtime you try to set the text property when you have the style set to dropdown list, you'll get the error you describe, just as if you tried to set the text property on a listbox control.

HTH

Bob
 
Hi,
I got the same error and was searching the net to find out if there is a solution when I stumbled upon these messages.

Like described here, it used to work before, but now I started getting the error.. obviously I did some changes to the application, but nothing related to the combo box or to the line of code that produced the error.

The solution I found was by fixing some other error which I made (in my case, a non existent file read) and the run-time error fixed itself.

I believe this is a case in which the reason for the error was totally wrong.

So, please try to step into the code patiently and find out what other possible bug you could find in the latest code changes.
 
I think Bob is right. I didn't find any error in code. But the mere fact that I didn't have this error before, makes me think that Vignesh is right. I don't know, I will have a closer look at the code in the weekend.
I had to deal these days with some viruses and spywares that I got from the internet so I didn't have time to have a closer look at the code.
Thanks a lot to Bob and Vignesh

Country of eagles
 

You can set the text property of a dropdown list as long as the value matches one of the items in the list...

Code:
Private Sub Form_Load()
    With Combo1 'Style = 2 Dropdown list
        .AddItem "One"
        .AddItem "Two"
        .AddItem "Three"
    End With
End Sub

Private Sub Command1_Click()
    'No error
    Combo1.Text = "Two"
End Sub

Private Sub Command2_Click()
    '383 error
    Combo1.Text = "Four"
End Sub
 
That's interesting, jjames. I never knew that. I've always used the ListIndex property to do that.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top