i 've declared a string str, and initialize str with a value as IT s1s2 26, i.e

String str;
str="IT s1s2 26";

normally it prints like this as usual IT s1s2 26

what i want is that :i want the str value to be at the str itself but during printing i want to see IT s1s2 with a font size 12 and the number 26 with a font size 16........

can anyone tell me how to do that.........

Recommended Answers

All 5 Replies

In a Console app this is not possible. Are you using a Forms app?
To do it you have to cut your string in two. Look for the method Substring of the String class how to do that. See on MSDN.

ya i'm doing in form application..............

you could try html in the code like so

String str;
      str="<html>IT s1s2 <h1>26</h1></html>";

That will change the size to make it a header, but I do not know how to set the size in html. I'm sure you could find it.

Where are you displaying the String? In a text component or where?
Different components have different ways of displaying text.

you could try html in the code like so

String str;
      str="<html>IT s1s2 <h1>26</h1></html>";

That will change the size to make it a header, but I do not know how to set the size in html. I'm sure you could find it.

thanks sir this code works beautifully............

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.