I’m using StringShape to put vertical labels in my app and that works fine, but how do I erase that StringShape?
The text for the StringShape comes from a TextField the user inputs, so I need to be able to erase the StringShape if the user changes the text, but I’m completely lost in how to do that.
I’ve been banging my head on this for hours and decided I’d better ask for help.
Jay
PS - I’ve played with StringShape and DrawRotatedTextMBS() but the problem exists with both.
How are you putting vertical labels in your app? What’s the code?
If you’re drawing to a Backdrop picture those persist. You’d need to erase the Backdrop before drawing the new, changed text. Or use a Paint event for drawing which can give a fresh slate each time.
OK, so when the text changes you need to tell the ContainerControl to redraw. Add a TextChange event to txt1Bit and in there call this (where MyContainerControl is your container name)
Sounds easy, but my ContainerControl doesn’t seem to have an Invalidate option. Could be because I’m a “little” out of date using RealStudio 2011 r4? (I’m trapped there because of a 3rd-party control.)
Invalidaterect or refreshrect the window in the area where the container exists?
dont use a container and just do it on the window directly?
In terms of how do you erase the text, you need to change or stop drawing the stringshape in the paint event.
Either set the text to “” or wrap the drawobject code in an ‘if’
[quote=239496:@Jay Jennings]Sounds easy, but my ContainerControl doesn’t seem to have an Invalidate option. Could be because I’m a “little” out of date using RealStudio 2011 r4? (I’m trapped there because of a 3rd-party control.)
[/quote]
Refresh was available. But if you have already refactored with Canvas, it’s alright.