为什么TDBGrid在运行时占用更多的空间? [英] Why does the TDBGrid take up more space at run-time?

查看:170
本文介绍了为什么TDBGrid在运行时占用更多的空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在设计时,我明确指出了TDBGrid的列(宽度和最大宽度)的大小。 p>

这是问题...

如您所见,设计时间和运行时网格的大小不同。并且还要注意,表单是相同的大小。



请忽略屏幕的其余部分。我唯一关心的是网格的窗口:)



有没有办法解决这个问题?



BTW,我正在使用Lazarus的Ubuntu,但软件可能在Ubuntu或Windows上。



我真的非常感谢这个的输入。
谢谢!

解决方案

我不知道这是否是正确的答案,但是在其他地方发布了一个简单的问题DELPHI这里:如何制作TDBGrid的列适合网格的宽度?



我在J.Pelttari这里使用了答案: http://stackoverflow.com/a/2004473/560161



我只是在每列的宽度上加1,看起来不错。



这是代码:

  for x:= 0 to dgFlockCodeSearch .Columns.Count-1 Do 
begin
dgFlockCodeSearch.Columns [x] .Width:= dgFlockCodeSearch.Columns [x] .Width +1;
结束


I have bumped into a pretty confusing problem.

At design time, I clearly indicate the size of columns (width and Max width) for the TDBGrid.

Here's the problem... As you see, the design time and run-time grids are different in size. And also note that the form is the same size.

Please ignore the rest of the screen. My only concern is the window with the grid :)

Is there any way I can fix this?

BTW, I'm working on Ubuntu with Lazarus but the software may be on Ubuntu or Windows.

I'd really appreciate nay inputs on this. Thanks!

解决方案

I'm not sure if this is the right answer but a simliar question was posted elsewhere about DELPHI here: How do I make a TDBGrid's columns fit the grid's width?

And I used the answer of J.Pelttari here: http://stackoverflow.com/a/2004473/560161

I simply added 1 to each column's width and it looks good.

Here's the code:

  for x:=0 to dgFlockCodeSearch.Columns.Count-1 Do
      begin
        dgFlockCodeSearch.Columns[x].Width:=dgFlockCodeSearch.Columns[x].Width +1;
      end;  

这篇关于为什么TDBGrid在运行时占用更多的空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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