Textbox scrolling problem
-
Hi guys, I want to setup scrolling in a textbox (or a label), which I intend to do using a combination of string methods Remove and Append, however I want to extend the concept slightly and only scroll when the text overflows the limits of the textbox. Unfortunately I can't seem to find any way of determining that the text has overflowed the boundary. Has anybody got any ideas? Cheers, Chris.
-
Hi guys, I want to setup scrolling in a textbox (or a label), which I intend to do using a combination of string methods Remove and Append, however I want to extend the concept slightly and only scroll when the text overflows the limits of the textbox. Unfortunately I can't seem to find any way of determining that the text has overflowed the boundary. Has anybody got any ideas? Cheers, Chris.
You'd need to create a graphics object to call MeasureString and see if the current text, with the current font, is bigger than the control.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
You'd need to create a graphics object to call MeasureString and see if the current text, with the current font, is bigger than the control.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Ok Christian, thanks for your advice. I'll give it a try and let you know how I get on. Thanks, Chris.
-
You'd need to create a graphics object to call MeasureString and see if the current text, with the current font, is bigger than the control.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Excellent stuff Christian, that worked a treat. Cheers!