Changing Text in Statics and controls at run time ?
-
Hi there All, Changing Text in Statics and controls at run time ? Well i'm trying to do something which i'm sure its possible and i dont know how. Actually i want to make a loop (which loop ??)through all the Controls and Windows under an SDI project and change all the labels of the controls\windows (including the static ones). How can this be done, I'll apritiate any help, Ariel.
-
Hi there All, Changing Text in Statics and controls at run time ? Well i'm trying to do something which i'm sure its possible and i dont know how. Actually i want to make a loop (which loop ??)through all the Controls and Windows under an SDI project and change all the labels of the controls\windows (including the static ones). How can this be done, I'll apritiate any help, Ariel.
When you say all the controls, what controls ? An SDI app has toolbar(s), a menu, but do you have controls embedded into your view, or in your toolbars ? Do you want to change YOUR items, or those provided by MFC ? The way to change the text is SetWindowText, the way to get ahold of an item you don't own ( for example if you subclass a common dialog ), is GetDlgItem, but I'm not sure how you would iterate through a dialog in a loop, unless you called GetDlgItem for ALL possible ID's and check for a valid return before calling SetWindowText. Christian The content of this post is not necessarily the opinion of my yadda yadda yadda. To understand recursion, we must first understand recursion.