试图解决这个简单的问题已经有1.5周了 [英] Its already 1.5 week trying to solve this simple problem

查看:97
本文介绍了试图解决这个简单的问题已经有1.5周了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我好累.当它向左滚动更改框位置时,我只想将我的16个组合框固定到我的16个datagridview列.

我只需要每个盒子都在网格列的头上即可.我尝试了很多东西TableLayoutPanel,弹出窗口.我会再解释一次,因为我的英语太烂了.

示例:combobox名称为comboboxBuyerName,dgv列名称为cBuyerName,它是网格中的最后一列,不适合表单,因此网格上有一个滚动条.当用户滚动时,comboboxBuyerName会自动显示.

请帮我.我需要此框作为过滤器bindingsource.我使用C#3.5 WinForms.

I am so tired. I just want to rope my 16 comboboxes to my 16 datagridview columns when its scrolled left changes boxes location.

I only need that every boxes be on head of grid columns. I tried lots of things TableLayoutPanel, popups. I will try again to explain it because my English sucks.

Example: combobox name is comboboxBuyerName and dgv column name is cBuyerName which is last column in grid and doesn''t fit on form so there is a scroll bar on grid. when user scrolls it comboboxBuyerName shows automaticly.

Please help me. I need this boxes for filter bindingsource. I use C# 3.5 WinForms.

推荐答案

我建​​议这种简单的解决方案
1.增加Datagridview的宽度,以便所有列均可见.它会比您的表单宽得多,但只需将其向左拖动并保持宽度增加即可.
2.在面板中移动您的datagridview.保持面板的宽度为您要查看的尺寸
3.将面板的"AutoScroll"属性设置为"True"
&而已.出现一个滚动条.

只需在面板内部将网格降低一点,以便为组合和腾出空间.将组合放置在列上方.用户滚动面板的内容,这将移动网格和面板.其他内容一起

工作吗?
I suggest this simple solution
1. Increase the width of Datagridview so that all columns are visible. It''ll be much wider than your form, but just drag it left and keep increasing the width.
2. Move your datagridview inside a panel. Keep the width of the panel to the size you wish to view
3. Set the ''AutoScroll'' property of the panel to ''True''
& that''s it. A scroll bar should appear.

Just lower the grid a little inside the panel to make room for your combos & place the combos above columns. The user scrolls the contents of the panel, which moves the grid & other contents together

Worked?


这篇关于试图解决这个简单的问题已经有1.5周了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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