简体   繁体   English

如何将VerticalAlignment设置为范围的底部?

[英]How do i set VerticalAlignment to bottom for range?

using Microsoft.Office.Interop.Excel;
Range rng = worksheet.UsedRange;

// I found below code but I didn't found ref to both ExcelAlignemt and excel I i missing something which ref required for this //我发现下面的代码,但我没有找到引用ExcelAlignemt和excel我错过了一些需要这样的ref

rng.VerticalAlignment = ExcelAlignment.xlButtom; //or Excel.XlHAlign.xlHAlignLeft

xlHAlignCenter is in Excel namespace: xlHAlignCenter位于Excel命名空间中:

worksheet.get_Range("A1", "A1").Style.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;

Now, with your code: 现在,使用您的代码:

rng.Style.VerticalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignLeft;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我水平排列ListViewItem时,项目在VerticalAlignment上居中排列,如何设置顶部VerticalAlignment? - When I arrange ListViewItem horizontal, the item arrange center on VerticalAlignment, how can I set top VerticalAlignment? 如何在Rich文本框中设置verticalalignment - how to set verticalalignment in Rich textbox 在WPF中使用多重绑定时如何设置VerticalAlignment? - How to set verticalAlignment while using multlibinding in wpf? 在DrawText中设置VerticalAlignment - Set VerticalAlignment in DrawText Excel 自动化:如何设置范围? - Excel automation: How do I set the range? 如何在C#中向Excel范围添加底部边框? - How can I add a bottom border to an Excel range in C#? 如何将RichTextBox滚动到底部? - How do I scroll a RichTextBox to the bottom? 如何在将要应用到Crystal报表的Web表单上设置范围参数? - How do I set a Range Parameter on the web form that will be applied on the crystal report? 如何将y轴的起始值设置为80并将其增加到1或0.5范围 - How do I set the starting value of the y axis to 80 and increment it my 1 or 0.5 range "<i>How i can set date picker range with in a financial year based on the document date?<\/i>如何根据文档日期在财政年度中设置日期选择器范围?<\/b> <i>Im using JQUERY to do this<\/i>我使用 JQUERY 来执行此操作<\/b>" - How i can set date picker range with in a financial year based on the document date? Im using JQUERY to do this
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM