你好。如何在C#的excel或电子表格的单元格中添加NumericUpDown控件 [英] Hi. How to Add NumericUpDown control inside the cell of excel or spreadsheet in C#

查看:128
本文介绍了你好。如何在C#的excel或电子表格的单元格中添加NumericUpDown控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Excel Cell设为NumericUpDown。我将excel cell设为ComboBox,但对NumericUpDown不了解。

解决方案

我不知道你在问题背后的确切背后是什么。但我猜以下代码对您有用。



  //  声明 
[DllImport( user32 )]
private extern static int GetCaretPos( out Point p);



调用函数并设置数值上下控制的界限如下。



  //  在事件方法中 
GetCaretPos( out cp);
numericUpAndDown1.SetBounds(cp.X,cp.Y + 50 100 50 );





谢谢。

Anand。 ģ


I want to make Excel Cell as NumericUpDown. I make excel cell as ComboBox but dose not any idea about NumericUpDown.

解决方案

I didn't know exactly whats you are developing behind on your question. But I guess the following code may useful to you.

//In Declaration 
[DllImport("user32")]
private extern static int GetCaretPos(out Point p);


Call the function and set the bounds of numeric up and down control as follows.

//In Event Method
GetCaretPos(out cp);
numericUpAndDown1.SetBounds(cp.X, cp.Y + 50, 100, 50);



Thanks.
Anand. G


这篇关于你好。如何在C#的excel或电子表格的单元格中添加NumericUpDown控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆