Setting Source of PageSource Control

Still have a lot to learn about Xojo. Tried searching forum and reading manual and it seems like following should work but I get error “Cannot assign a value to this property.”

Create PageSource1 control. In Open event add:

me.Source = "

Hello there.

Running produces error “Cannot assign a value to this property.”

If I put the source directly in the Inspector field for Source it works.

I think the .Source property is read only. Try me.EditSource = "

Hello there.

The only place you can modify the source at runtime is in the EditSource event of the PageSource control. Also, this event only fires once per page instantiation.

Still not working. Tried putting this in the EditSource event:

me.Source = "

Hello there.

Also tried the first suggestion but that didn’t work (EditSource is an event, not a property, but I tried it anyway because I don’t know what I am doing).

Any other ideas?

Ok, quick followup. The following line placed in the EditSource event DOES work but can someone please explain why?

Source = "

Hello there.

Note that the “me.” is taken off of the front of the line. By the way, this is exactly what the manual shows (just “Source =”, not "me.Source = ") so I will pay closer attention in future but I still want to know why putting the “me.” in front, in this case, causes an error.

Still confused…

[quote=62041:@Loren Staplin]Ok, quick followup. The following line placed in the EditSource event DOES work but can someone please explain why?

Source = "

Hello there.

Note that the “me.” is taken off of the front of the line. By the way, this is exactly what the manual shows (just “Source =”, not "me.Source = ") so I will pay closer attention in future but I still want to know why putting the “me.” in front, in this case, causes an error.

Still confused…[/quote]
Because “Source” is a parameter to the event. “Me.Source” is a property on the PageSource control, which is read-only. Look at the method header while in the event code editor and you’ll see the parameters you have access to, in this case Source and Location.

Thanks Jay. I think I understand what you are saying but it is still confusing (to me). I think I have to read up on what ByRef means in the method header.