Click here to Skip to main content
15,917,176 members
Home / Discussions / C#
   

C#

 
GeneralRe: Run a C# program in Dos window Pin
.NET- India 28-Nov-07 21:32
.NET- India 28-Nov-07 21:32 
AnswerRe: Run a C# program in Dos window Pin
m@u28-Nov-07 21:22
m@u28-Nov-07 21:22 
AnswerRe: Run a C# program in Dos window Pin
sreejith ss nair28-Nov-07 22:35
sreejith ss nair28-Nov-07 22:35 
AnswerRe: Run a C# program in Dos window Pin
PIEBALDconsult29-Nov-07 3:12
mvePIEBALDconsult29-Nov-07 3:12 
QuestionCustomControl.Paint Not Firing Pin
Sukhjinder_K28-Nov-07 21:02
Sukhjinder_K28-Nov-07 21:02 
AnswerRe: CustomControl.Paint Not Firing Pin
m@u28-Nov-07 21:11
m@u28-Nov-07 21:11 
GeneralThanks it Worked... Pin
Sukhjinder_K28-Nov-07 21:55
Sukhjinder_K28-Nov-07 21:55 
AnswerRe: CustomControl.Paint Not Firing Pin
Luc Pattyn28-Nov-07 22:01
sitebuilderLuc Pattyn28-Nov-07 22:01 
GeneralTwo YoLabels. How??? Pin
Sukhjinder_K28-Nov-07 23:19
Sukhjinder_K28-Nov-07 23:19 
GeneralRe: Two YoLabels. How??? Pin
Luc Pattyn29-Nov-07 0:06
sitebuilderLuc Pattyn29-Nov-07 0:06 
Questionabout encoding Pin
jason_mf28-Nov-07 20:52
jason_mf28-Nov-07 20:52 
AnswerRe: about encoding Pin
ChandraRam29-Nov-07 1:46
ChandraRam29-Nov-07 1:46 
QuestionConfiguration settings reading - Performance perceptive Pin
N a v a n e e t h28-Nov-07 20:32
N a v a n e e t h28-Nov-07 20:32 
AnswerRe: Configuration settings reading - Performance perceptive Pin
Charith Jayasundara28-Nov-07 20:39
Charith Jayasundara28-Nov-07 20:39 
GeneralRe: Configuration settings reading - Performance perceptive Pin
N a v a n e e t h28-Nov-07 21:53
N a v a n e e t h28-Nov-07 21:53 
GeneralRe: Configuration settings reading - Performance perceptive Pin
Charith Jayasundara28-Nov-07 22:27
Charith Jayasundara28-Nov-07 22:27 
QuestionCreating a Login Form Pin
Nitin.raj28-Nov-07 20:19
Nitin.raj28-Nov-07 20:19 
AnswerRe: Creating a Login Form Pin
harleydk28-Nov-07 22:06
harleydk28-Nov-07 22:06 
QuestionHow to do Format Excel Cells in C# Pin
Charith Jayasundara28-Nov-07 18:51
Charith Jayasundara28-Nov-07 18:51 
AnswerRe: How to do Format Excel Cells in C# Pin
sreejith ss nair28-Nov-07 20:42
sreejith ss nair28-Nov-07 20:42 
Hi,
You might required to reach the required cells/range of cells to format the cells.
 Excel.Application excelApp = new Excel.ApplicationClass();<br />
   Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(File_Path,<br />
                                  0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",<br />
                                  true, false, 0, true, false, false);<br />
   Excel.Sheets excelSheets = excelWorkbook.Worksheets;<br />
   Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(fileName);<br />
   Excel.Range excelCells;<br />
<br />
   excelCells = (Excel.Range)excelWorksheet.get_Range("A1", "G1");<br />
   excelCells.Select();<br />


The above example code will select a range of cells from A1 (column name) to G1 (column name). Now you have range of required cells to apply any specific format.

Here let me explian some formating tips interms of Font style and name.

excelCells.WrapText=true;<br />
                   excelCells.HorizontalAlignment=Excel.Constants.xlCenter;<br />
                   excelCells.Borders.LineStyle=Excel.Constants.xlSolid;<br />
                   excelCells.Font.Bold = true;<br />
                   excelCells.Font.Size = 9;<br />
                   excelCells.Font.Name = "Verdana";


If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com

GeneralRe: How to do Format Excel Cells in C# Pin
Charith Jayasundara28-Nov-07 21:03
Charith Jayasundara28-Nov-07 21:03 
GeneralRe: How to do Format Excel Cells in C# Pin
sreejith ss nair28-Nov-07 21:16
sreejith ss nair28-Nov-07 21:16 
Questionremote database accessing Pin
dayya28-Nov-07 18:27
dayya28-Nov-07 18:27 
AnswerRe: remote database accessing Pin
Pankaj - Joshi28-Nov-07 18:54
Pankaj - Joshi28-Nov-07 18:54 
GeneralRe: remote database accessing Pin
dayya28-Nov-07 19:38
dayya28-Nov-07 19:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.