Tag: 填充

如何在wpf中设置内部TextBoxView上的边距

我有一个案例,我想最小化文本框的水平填充。 使用snoop我发现文本框由多个子控件组成。 其中一个是TextBoxView,边距为2,0,2,0 TextBoxView是一个内部wpf组件,没有公共API。 你会如何摆脱“内部填充”?

WinForms TreeView递归目录列表?

我想制作一个显示系统上所有文件夹的树视图,并且只显示音乐文件,例如.mp3 .aiff .wav等。 我记得读过我需要使用递归函数或类似的东西。

洪水填充递归算法

我正在尝试制作一个可以在c#中填充int数组的算法。 基本上,作为MS Paint中的填充工具,我有一个颜色,如果我在数组中选择(x,y)坐标,它会用新颜色替换所有具有相同初始颜色的邻居。 例如: [0,0,0] [0,1,0] [1,1,0] 如果我将3放入(0,0),则数组变为: [3,3,3] [3,1,3] [1,1,3] 所以我在递归中尝试了它并且确实有效,但并非总是如此。 实际上,我有时会出现“Stack Overflow”错误(似乎合适)。 这是我的代码,如果你能告诉我什么是错的话会很棒:) public int[,] fill(int[,] array, int x, int y, int initialInt, int newInt) { if (array[x, y] == initialInt) { array[x, y] = newInt; if (x 0) array = fill(array, (x – 1), y, initialInt, newInt); if (y 0) array = […]

AES填充并将密文写入磁盘文件

我有一个字符串,我用C ++使用Crypto ++加密以下mehtod: std::ifstream t(filename); //File to be encrypt std::stringstream buffer; buffer << t.rdbuf(); ofstream combined_file2(filename2); //Encrypted file combined_file2 << encrypt(buffer.str()); string encrypt(string data) { // Key and IV setup std::string key = "0123456789abcdef"; std::string iv = "aaaaaaaaaaaaaaaa"; //Alternative //byte key[CryptoPP::AES::DEFAULT_KEYLENGTH], iv[CryptoPP::AES::BLOCKSIZE]; //memset(key, 0x00, CryptoPP::AES::DEFAULT_KEYLENGTH); //memset(iv, 0x00, CryptoPP::AES::BLOCKSIZE); std::string plaintext = data; std::string ciphertext; // […]

Winforms,在使用Dock属性时创建填充

使用dockstyle.top属性时,如何在文本框之间添加填充或空格? for(int i =0; i< 10; i++) { textboxes[i] = new TextBox(); textboxes[i].Dock = DockStyle.Top; mypanel.Controls.Add(textboxes[i]); } 上面的代码将文本框放在彼此的正下方。 如果不使用质量面板或固定定位,无法解决这个问题。 怎么做以下? 1)我想在盒子之间添加大约10-20像素。 2)如何更改文本框的大小(高度,宽度),因为使用dockstyle.top时它会忽略size命令?

ASP.NET MVC – 填充下拉列表

我是ASP.NET MVC的新手。 我正在试图弄清楚如何从我的数据库中的值创建一个基本的下拉列表。 在ASP.NET Web表单中,我知道我可以加载下拉列表,如下所示: Page.aspx Page.aspx.cs void myDropDownList_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { List people = GetPeopleFromDatabase(); myDropDownList.DataSource = people; myDropDownList.DataBind(); } } 我如何在ASP.NET MVC中执行相同类型的操作? 谢谢!

NumericUpDown with Unit | 定制控制| 场填充

我试图创建一个inheritanceNumericUpDown以显示可设置单位的自定义控件。 这是(视觉上)到目前为止我得到的: 我的代码: 看起来有点长,但不是那么做 class NumericUpDownUnit : NumericUpDown { public event EventHandler ValueChanged; /// /// Constructor creates a label /// public NumericUpDownUnit() { this.TextChanged += new EventHandler(TextChanged_Base); this.Maximum = 100000000000000000; this.DecimalPlaces = 5; this.Controls.Add(lblUnit); lblUnit.BringToFront(); UpdateUnit(); } public void TextChanged_Base(object sender, EventArgs e) { if(ValueChanged != null) { this.ValueChanged(sender, e); } } /// /// My […]