Any thoughts?
Hey David,
Is it possible to scroll through a label object? Basically I would users to scroll through the text assigned to a label if the data becomes too long to display(Like the Listbox objects) in my plug-in.
I guess that I could figure out how many lines I can fit in the label and then load parts of the string as the down/up arrow is pressed.
I noticed that there is the following in the SDK; I just haven't seen it used in the sample code:
CFControls.skinLabel
needScroll - Label need scrolling flag (Field)
Just wanted to see if you might have a recommendation for this.
Any thoughts?
needScroll is a flag you can set to use if you want too... Labels can be created to scroll, but it would have to be programming in on the plugin side currently...
it's not that hard to get a temp variable and scroll the lables you need to scroll, pulling off the text and invalidating the lable area...
david
__________________
CENTRAFUSE http://www.centrafuse.com
01 Jeep Cherokee Sport 4x4 Installed
M10000/512Mb/20GB, Lilliput 7", Holux GM-210
Sorry to be a pain but I am not quite sure how to go about this...
I would need to set some kind of limit based off of the label itself in order to determine when the string I am loading into the label is too long and has to be split.
Which properties could I use to accomplish this?
here you go:
davidCode:string text = "new text for the label"; CFControls.skinLabel temp = (CFControls.skinLabel)labelArray[CF_getLabelID("NAMEOFMYLABEL")]; if(text != null) { temp.Text = text; temp.Draw = true; StringFormat sf = StringFormat.GenericDefault; sf.FormatFlags |= StringFormatFlags.MeasureTrailingSpaces; Graphics g = this.CreateGraphics(); int iWidth = (int)g.MeasureString(temp.Text, temp.Font, 0, sf).Width; if(iWidth > temp.Bounds.Width) { //Do What you need to do because the text is too long } g.Dispose(); labelArray[CF_getLabelID("MAINTITLE")] = temp; this.Invalidate(new Rectangle(temp.Bounds.X, temp.Bounds.Y, temp.Bounds.Width, temp.Bounds.Height), false); }
__________________
CENTRAFUSE http://www.centrafuse.com
01 Jeep Cherokee Sport 4x4 Installed
M10000/512Mb/20GB, Lilliput 7", Holux GM-210
I put this code into my plug-in and am having issues with the code thinking the text is out of bounds, when it really isn't.
I have attached an example of what I am trying to do.
I am writing a plug-in for AOL Instant Messenger and I need the label to handle two things:
1. Once the message text becomes to large, automatically scroll the label to show the most current text.
2. Via the up and down buttons, allow the user to scroll the text in the label and read older text not currently displayed on the screen.
Hopefully that is descriptive enough, I have tried to work with the example code, but haven't been able to get things working right.
It's as simple as storing the main string in a variable and only updating the labels text with what can fit...
david
__________________
CENTRAFUSE http://www.centrafuse.com
01 Jeep Cherokee Sport 4x4 Installed
M10000/512Mb/20GB, Lilliput 7", Holux GM-210
Yes, I guess what I was getting at in the last post was the code you posted was telling me the the main string would be out of bounds when in fact it had plenty of room to fit.
I was wondering if the code you provided was for another use ... say for the main song title label scroll.
__________________
CENTRAFUSE http://www.centrafuse.com
01 Jeep Cherokee Sport 4x4 Installed
M10000/512Mb/20GB, Lilliput 7", Holux GM-210
David, any chance that you could help me out with this, this weekend?
Bookmarks