佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 956|回复: 1

VB Msflexgrid 的问题

[复制链接]
发表于 30-12-2007 01:38 PM | 显示全部楼层 |阅读模式
我现在做了一个calculator,全部value会add在grid里面。但是现在当我每add一次value进grid,它并不会自动add
在new row,而是会replace旧的value。以下是我的code。请教一下怎么solve以下的code。


If txt_height.Text = "" Or txt_width.Text = "" Or txt_height.Text = "." Or txt_width.Text = "." Or txt_quantity.Text = "" Then
grid_total.TextMatrix(1, 0) = ""
grid_total.TextMatrix(1, 1) = ""
grid_total.TextMatrix(1, 2) = ""
grid_total.TextMatrix(1, 3) = ""
Else

Dim X As Integer
    X = 1
            grid_total.Rows = grid_total.Rows + 1
            grid_total.TextMatrix(X, 0) = txt_width.Text + Space(1) + list_dimen.Text + Space(1) + "x" + Space(1) + txt_height.Text + Space(1) + list_height.Text
            grid_total.TextMatrix(X, 1) = txt_quantity.Text
            grid_total.TextMatrix(X, 2) = list_price.Text
            grid_total.TextMatrix(X, 3) = txt_total.Text
End If
回复

使用道具 举报


ADVERTISEMENT

发表于 2-1-2008 07:23 PM | 显示全部楼层
原帖由 Stylehoong 于 30-12-2007 01:38 PM 发表
我现在做了一个calculator,全部value会add在grid里面。但是现在当我每add一次value进grid,它并不会自动add
在new row,而是会replace旧的value。以下是我的code。请教一下怎么solve以下的code。


If txt_heigh ...


你的 X value 一直都是等于 1,所以会一直 replace 在旧的 value

把 X value 改成 (grid_total.Rows - 1) 应该就可以了

[ 本帖最后由 雪儿与小鱼儿 于 2-1-2008 07:26 PM 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 23-9-2025 09:29 AM , Processed in 0.121677 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表