|
|
 |
BOOK: Beginning Visual C#  | This is the forum to discuss the Wrox book Beginning Visual C#, Revised Edition of Beginning C# for .NET v1.0 by Karli Watson, David Espinosa, Zach Greenvoss, Jacob Hammer Pedersen, Christian Nagel, Jon D. Reid, Matthew Reynolds, Morgan Skinner, Eric White; ISBN: 9780764543821 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning Visual C# section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

May 17th, 2009, 03:52 AM
|
|
Registered User
|
|
Join Date: May 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Having two different fonts/color within same Excel Cell
I need to Display something like this:
This is ALL in one cell
HELP - How do I do that?
The best reference I have is:
Code:
Microsoft.Office.Tools.Excel.NamedRange charactersRange;
private void FormatCharacters()
{
charactersRange = this.Controls.AddNamedRange(
this.Range["A1", "A1"], "charactersRange");
this.charactersRange.Value2 = "Smith";
this.charactersRange.Characters[1, 1].Font.Bold = true;
this.charactersRange.Characters[1, 1].Font.Size = 14;
}
From: http://msdn.microsoft.com/en-us/libr...rs(VS.80).aspx
But I can't seem to get the namespace/Reference correct....
I can change any cell to any color/font/size/alignment/ect.. even add hyperlink correctly but can't seem to get two fonts or color type in same cell.....
It's gotta lie with "NamedRange" / "Character" reference..
.just can't get it to compile or work.... PLZ help.....
Sample Working Code from my project:
Code:
((Excel.Range)oSheet.Columns["A:M", Type.Missing]).Font.Size = 9;
oSheet.get_Range("L1", "L1").Interior.ColorIndex = 15;
oSheet.get_Range("A1", "L1").EntireColumn.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;
oSheet.get_Range("A:A", "L:L").VerticalAlignment = Excel.XlVAlign.xlVAlignTop;
oSheet.get_Range("A:A", "L:L").HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft;
oSheet.Hyperlinks.Add(oSheet.get_Range("A" + tempRowCount, Type.Missing), tempHyperLink, Type.Missing, "Reference to:" + listView3.Items[row].SubItems[col].Text.ToString(), listView3.Items[row].SubItems[col].Text.ToString());
Last edited by tom1002 : May 17th, 2009 at 06:09 PM.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |