Get/Set Properties in Dialog Panels

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Get/Set Properties in Dialog Panels

Post by winstein » Mon Nov 04, 2013 3:35 am

A quick question, but how do you modify properties that are within a panel? Say, I have a Panel in the Dialog, but I put a Label in the Panel. I want this Label to change to whatever value outside the Dialog settings.

The current format for changing dialog properties is as follow:

SetDialogProperty>Dialog Name,Object Name, Property Name, Value

It's the Object Name that I am stumped at. When I put Panel1, the Label's text didn't change. Putting Label1 didn't change the text in the Panel either. I tried Panel1.Label1, but it didn't have much of an effect.

How should I change properties that are nested within a Panel?

Thanks for reading.
PPQ

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Nov 04, 2013 12:40 pm

1. Open the dialog designer.
2. Click on the label inside your Panel
3. Scroll to "Name" in the Properties list, that's the object name.

Image

You would use Label1 in this example:
SetDialogProperty>Dialog1,Label1,Caption,Your Text Here

I hope this helps.

User avatar
PepsiHog
Automation Wizard
Posts: 512
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Post by PepsiHog » Mon Nov 04, 2013 2:16 pm

@ winstein,

Labels can be problematic when trying to change their text. I don't know if this has improved in newer versions, but I am using version 12.

I usually have more than one label in the same spot. I make one visible and the other not. Then I use the sdp to switch which one is visible

SetDialogProperty>DIalog1,Label1,Visible,False
SetDialogProperty>Dialog1,Label2,Visible,True

Sometimes I'll use an Edit box. I just remove the border and color it the same as the window it's in. This way I only need the one, and changing the text is easily done using sdp>.

Hope this helps you.
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Mon Nov 04, 2013 3:40 pm

@PepsiHog,

I've never had a problem dynamically changing labels in any version of Macro Scheduler, I started with version 6. Its particularly pain free starting with version 12. All you need to do is use the SetDialogProperties> function to alter the label object's "Caption".

SetDialogProperty>DIalog1,Label1,Caption,This is the new text displayed in Dialog1

@Winstein,

Every object in a dialog has a unique name. It doesn't matter whether that object is displayed in the primary client area of the dialog or in a panel or in a tabpage. The name of the object is unique and its properties can be altered using

SetDialogProperties>Dialog name,object name,property name,change

winstein
Pro Scripter
Posts: 84
Joined: Mon Nov 26, 2012 3:44 pm

Post by winstein » Wed Nov 06, 2013 1:20 am

JRL wrote:@Winstein,

Every object in a dialog has a unique name. It doesn't matter whether that object is displayed in the primary client area of the dialog or in a panel or in a tabpage. The name of the object is unique and its properties can be altered using

SetDialogProperties>Dialog name,object name,property name,change
After some testing on this, you are right in that I need to use the Caption property instead of the Text property, since that is what will dynamically change the text.

In that case, the problem is solved.
PPQ

User avatar
PepsiHog
Automation Wizard
Posts: 512
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Post by PepsiHog » Mon Nov 11, 2013 5:35 am

Maybe at the time I also was trying to set the Text property. I'll check it out the next time it comes up in a macro of mine.

Thanks JRL.

PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts