Problem with setting of property Backcolor

Issues and Discussions related to Harbour

Moderator: Rathinagiri

Post Reply
dominique_devuyst
Posts: 22
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium

Problem with setting of property Backcolor

Post 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
edk
Posts: 914
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Problem with setting of property Backcolor

Post by edk »

It should be like this

Code: Select all

Win_PlView.Label_1.BackColor := aColor2
dominique_devuyst
Posts: 22
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium

Re: Problem with setting of property Backcolor

Post 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
edk
Posts: 914
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Problem with setting of property Backcolor

Post 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
dominique_devuyst
Posts: 22
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium

Re: Problem with setting of property Backcolor

Post by dominique_devuyst »

Yes ....
All my windows were declared in my main EXCEPT Win_PlView !
I knew it was a stupidity .... :?
Thank you edk :)
Post Reply