We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Design-Time Properties in an OCX

percosolator
percosolator asked
on
Medium Priority
276 Views
Last Modified: 2010-05-03
I have an OCX made from a 'TextBox' control provided with VB.  

I recently wanted to add an alignment property to this control.  

The problem that I am encountering is that when I go to compile, VB says, "Can't Assign to Read-Only Property" because, to the embedded TextBox control, it _is_ runtime, even though, to the OCX it is design time.

The actual statement is this:

Public Property Let Alignment(A As AlignmentConstants)
    Text1.Alignment = A
End Property

The compile stops cold, with "Alignment" highlighted.

The question is:  How do you alter run-time, read-only properties in component controls of an OCX?

Comment
Watch Question

IT Director / IT Project Manager
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I found someone elses solution about using multiple text boxes, not an elegant solution, but I'll use it if I can't find an alternative.

Are you (or is anyone) aware of an API that might help?
Dr. Kamal MehdiIT Director / IT Project Manager
CERTIFIED EXPERT

Commented:
>> Are you (or is anyone) aware of an API that might help?

Unfortunately, NO. I have no idea on how to do this using API.

Author

Commented:
Kamall,

I was looking around and saw that "C" I gave you.  Sorry about that, doesn't appear to be any way around this issue.  

I will give you a better one next time, k? Got a couple lurking about that I have been tempted to post, but I always love a good challenge.

Dr. Kamal MehdiIT Director / IT Project Manager
CERTIFIED EXPERT

Commented:
percosolator,
Thank you for your comment, and don't worry about the 'C' grade.
I am here to help you and the other people.
Have a nice day.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.