Page 1 of 1
Problem with setting of property Backcolor
Posted: Fri Jul 26, 2019 5:36 pm
by dominique_devuyst
Hello everybody,
I have a problem with the property BackColor of a label :
Code: Select all
if x==1
// Win_PlView.Label_1.BackColor.value := aColor2 // marche pas : error0030
SetProperty("Win_PlView", "Label_1", "BackCOLOR",aColor2) // marche
SetProperty("Win_PlView", "Label_No", "BackCOLOR",aColor1)
etc ....
it's probably a stupid mistake of me but I do not understand why the first way to define this parameter does not work : error0030. With SetProperty(...) : no problem.
Somebody can help me?
best regards
Re: Problem with setting of property Backcolor
Posted: Fri Jul 26, 2019 6:57 pm
by edk
It should be like this
Code: Select all
Win_PlView.Label_1.BackColor := aColor2
Re: Problem with setting of property Backcolor
Posted: Sat Jul 27, 2019 3:42 pm
by dominique_devuyst
Hello edk,
Yes it's right. I first wrote this way but it does not work.
Nor with the value :
Code: Select all
if x==1
// Win_PlView.Label_1.BackColor := aColor2 // marche pas : error0030
// SetProperty("Win_PlView", "Label_1", "BackCOLOR",aColor2) // marche
Win_PlView.Label_1.value :="* " + "Nom commun" // marche pas : error0030
SetProperty("Win_PlView", "Label_1", "value","* " + "Nom commun") // marche
The compiler give this message :
Process started >>>
Harbour 3.2.0dev (r1601151502)
Copyright (c) 1999-2015, http://harbour-project.org/
Main.Prg(117) Error E0030 Syntax error "syntax error at '.'"
1 error
Re: Problem with setting of property Backcolor
Posted: Sat Jul 27, 2019 5:39 pm
by edk
If you have a window definition in another prg, you have to declare a window in that prg in which you want to refer to this window.
http://hmgforum.com/hmgdoc/data/declarewindow.htm
Try DECLARE WINDOW Win_PlView
Re: Problem with setting of property Backcolor
Posted: Mon Jul 29, 2019 12:47 pm
by dominique_devuyst
Yes ....
All my windows were declared in my main EXCEPT Win_PlView !
I knew it was a stupidity ....
Thank you edk
