Hi guys,
I've been planning to modify Label text size using "for" loops. To check for the type of control, I'm using GetCtrlAttribute.I tried to run but it shows an error. "The Attribute passed is not valid"
Code:
GetPanelAttribute(panelHandle, ATTR_NUM_CTRLS, &i_num_of_controls);
for ( i = 2; i <= i_num_of_controls ; i++ )
{
// Transform the label attributes of the control.
if (GetCtrlAttribute (panelHandle, i, ATTR_LABEL_POINT_SIZE,&i_org_text_size) >= 0 )
{
f_new_text_size =ceil( (float) i_org_text_size * 0.8);
SetCtrlAttribute(panelHandle, i, ATTR_LABEL_POINT_SIZE, (int)f_new_text_size);
}
}
Error :
This error is prompted because, the control id passed into the GetCtrlAttribute, is not a "Label" control id.
I can bypass the error by manually check which control id is a Label control and put the id number as one of the if condition. This is not what I want to apply right now.
Question:
1. So, does anyone know, how can I check for Label control without having to check manually by getting the label's id from header file?
Thank you!