DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: a1367230164
今日帖子: 17
在线用户: 26
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 wangwq (jason) ★☆☆☆☆ -
普通会员
2004/2/24 13:12:09
标题:
Tstringgrid控件高深使用方法 浏览:1284
加入我的收藏
楼主: 我一个EDIT控放在在Tstringried上,在获取Tstringgrid每个小单无时坐标本人不会下面是我写的单代码,这是我写了一个函数,请帮我补充他的宽和高
 procedure TForm1.nextposition( var r:integer; var c:integer);
   begin
     //with do
         //begin

             edit1.Width :=    ;
             edit1.Height :=   ;
             edit1.Left :=stringgrid1.Left+stringgrid1.ColWidths[r];
             edit1.Top:=stringgrid1.Top+stringgrid1.RowHeights[c];
             edit1.Text :=stringgrid1.Cells[r,c]
         //end;   //使用文本匡付传值
   end;
----------------------------------------------
-
作者:
男 fwjindream (fwjindream) ★☆☆☆☆ -
盒子活跃会员
2004/2/24 13:48:37
1楼: 错。
----------------------------------------------
我是鸟菜
作者:
男 bios (阿贡) ★☆☆☆☆ -
盒子中级会员
2004/2/24 21:47:05
2楼: 无聊的人!
----------------------------------------------
按此在新窗口浏览图片
按此在新窗口浏览图片
作者:
男 hotyei (青出于蓝) ★☆☆☆☆ -
盒子活跃会员
2004/2/24 23:13:39
3楼: TStringGrid本来就可以进行编辑,没必要再放个Edit。
----------------------------------------------
米软科技有限公司http://www.szmesoft.com
作者:
男 fwjindream (fwjindream) ★☆☆☆☆ -
盒子活跃会员
2004/2/25 8:14:58
4楼: var
        i:integer;
        rt,cl:integer;
        h:integer;
begin
        edit1.Width :=sg.ColWidths[sg.Col]+2;
        edit1.Height :=sg.RowHeights[sg.Row]+2;

        rt:=sg.TopRow;
        cl:=sg.LeftCol;

        h:=sg.Top +sg.RowHeights[0]+sg.GridLineWidth;
        for i:=sg.TopRow to sg.Row do
          begin
                h:=h+sg.RowHeights[i]+sg.GridLineWidth;
          end;

        edit1.Top :=h-edit1.Height+2;
        label7.Caption :=inttostr(h);

        h:=sg.Left +  sg.ColWidths[0]+2;
        for i:=sg.LeftCol to sg.Col do
          begin
                h:=h+sg.ColWidths[i]+sg.GridLineWidth;
          end;
        edit1.Left :=h-edit1.Width+sg.GridLineWidth;
        label8.Caption :=inttostr(h);
----------------------------------------------
我是鸟菜
作者:
男 wangwq (jason) ★☆☆☆☆ -
普通会员
2004/3/5 11:11:13
5楼: 非常感谢这么仁兄
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行62.5毫秒 RSS