We'll do this using the Canvas object.
I'm just learning but pretending that I can teach it
Download the provided CanvasTest.zip and open it.
What I've done here is to create a panel and then stick a Canvas on it.
Then using the DrawTextRotated method of the Canvas we can make a vertical lable.
The DrawTextRotated method (and all the other methods of the Canvas object) draw on a bitmap.
There doesn't seem to be any easy way to just wipe that bitmap so what I'm doing here is first writing text in black, then remembering that text and before writing new text i'm writing that same text but in white, effectively deleting all the pixels that were written to in black.
We should de-couple it a bit more for example the line:
Canvas1.DrawTextRotated(rememberedText, 0, 0, Typeface.DEFAULT, 20, Colors.White, "LEFT", 90)
is written in two different places with the only difference being the colour.
The colours are an 'enum' (enumeration) so maybe we can use a Long variable to decide if we should paint white or black pixels and then we'd only need that line once.
the 0,0 bit is deciding if there should be 'margin' on the bottom of, or to the left of the text and also depends on the alignment part currently set to "LEFT"
Have a play and come with your own ideas.
The Canvas looks to be mightily powerful!
Try also changing the last number currently set to 90 (degrees) but remember that if you first 'draw' on the canvas and then change it before you have 'cleared' it using white text then you'll have lots of black pixels all over the place
I'm just learning but pretending that I can teach it
Download the provided CanvasTest.zip and open it.
What I've done here is to create a panel and then stick a Canvas on it.
Then using the DrawTextRotated method of the Canvas we can make a vertical lable.
The DrawTextRotated method (and all the other methods of the Canvas object) draw on a bitmap.
There doesn't seem to be any easy way to just wipe that bitmap so what I'm doing here is first writing text in black, then remembering that text and before writing new text i'm writing that same text but in white, effectively deleting all the pixels that were written to in black.
We should de-couple it a bit more for example the line:
Canvas1.DrawTextRotated(rememberedText, 0, 0, Typeface.DEFAULT, 20, Colors.White, "LEFT", 90)
is written in two different places with the only difference being the colour.
The colours are an 'enum' (enumeration) so maybe we can use a Long variable to decide if we should paint white or black pixels and then we'd only need that line once.
the 0,0 bit is deciding if there should be 'margin' on the bottom of, or to the left of the text and also depends on the alignment part currently set to "LEFT"
Have a play and come with your own ideas.
The Canvas looks to be mightily powerful!
Try also changing the last number currently set to 90 (degrees) but remember that if you first 'draw' on the canvas and then change it before you have 'cleared' it using white text then you'll have lots of black pixels all over the place