佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1183|回复: 8

label 的VB Code 问题。。。

[复制链接]
发表于 14-9-2007 10:47 PM | 显示全部楼层 |阅读模式


有人能帮得到我吗?上面图案的VB program, 我不大会如何把input show 在像这样的Label(看看红色箭头), 像Table look一样整齐的呈现出来output。感谢你们。。。
回复

使用道具 举报


ADVERTISEMENT

发表于 14-9-2007 11:05 PM | 显示全部楼层
原帖由 peepee 于 14-9-2007 10:47 PM 发表
http://i45.photobucket.com/albums/f85/cheewei29/screen.jpg

有人能帮得到我吗?上面图案的VB program, 我不大会如何把input show 在像这样的Label(看看红色箭头), 像Table look一样整齐的呈现出来output。 ...


你指的 Table look 是不是 ListView?
回复

使用道具 举报

 楼主| 发表于 14-9-2007 11:23 PM | 显示全部楼层
原帖由 hooi1983 于 14-9-2007 11:05 PM 发表


你指的 Table look 是不是 ListView?


大概是这样吧,但又好像不是 @_@ 你看Label内中间上四排字都很整齐的。
回复

使用道具 举报

发表于 15-9-2007 02:27 PM | 显示全部楼层
原帖由 peepee 于 14-9-2007 11:23 PM 发表


大概是这样吧,但又好像不是 @_@ 你看Label内中间上四排字都很整齐的。


可以 hardcode 你的 Textbox/Label 的位置&数量
也可以用 coding 来 generate Textbox/Label 的位置&数量
也可以用 ListView/DataGrid
回复

使用道具 举报

 楼主| 发表于 15-9-2007 04:38 PM | 显示全部楼层
原帖由 hooi1983 于 15-9-2007 02:27 PM 发表


可以 hardcode 你的 Textbox/Label 的位置&数量
也可以用 coding 来 generate Textbox/Label 的位置&数量
也可以用 ListView/DataGrid


我也这么认为,就是可以用 coding 来 generate Textbox/Label 的位置&数量,但我忘了怎么去写,请问它的coding是怎样的?
回复

使用道具 举报

发表于 16-9-2007 12:41 AM | 显示全部楼层
原帖由 peepee 于 15-9-2007 04:38 PM 发表


我也这么认为,就是可以用 coding 来 generate Textbox/Label 的位置&数量,但我忘了怎么去写,请问它的coding是怎样的?


Textbox/Label 的数量可以用 control array 来控制
如 txtName(0),txtName(1)...

Textbox/Label  的位置就要用 .Move 来控制
.Move 包括了 .Left, .Top, .Width & .Height
回复

使用道具 举报

Follow Us
发表于 19-9-2007 11:13 AM | 显示全部楼层
用listview 可以很快的弄好
回复

使用道具 举报

发表于 21-9-2007 11:23 PM | 显示全部楼层
tab = vbTab
新的一行 = vbCrLf 或 vbCr
回复

使用道具 举报


ADVERTISEMENT

发表于 22-9-2007 08:46 AM | 显示全部楼层

'Original create by Zhixuen
'Date : 22 / 09 / 2007
'Time 8:40AM

Private i As Integer
Private countctrl As Integer
Private Sub Command1_Click()
Dim Label1 As Label
Dim ctrl As Control
i = i + 1
countctrl = 1
Set Label1 = Me.Controls.Add("VB.LABEL", "label1" & i, Me) ' Add New control by increment of number i to avoid duplication of label name
With Label1  'label setup
    Label1.Move  1000, 1000, 1000, 1000 ' Please specified the left,top,width,length
    Label1.Visible = True 'set label visible
    Label1.Caption = "asadsadasd" 'give label caption text
End With
For Each ctrl In Me.Controls ' loop through form control
    If TypeOf ctrl Is Label Then 'determine typeof ctrl is label
        If ctrl.Name Like "label1*" Then 'Search the label name is start from text label1
            countctrl = countctrl + 1 'increment of count to counting the number of label
        End If
      
    End If
   
Next
Debug.Print countctrl   '  how many label control is exist ( Only for added control )
End Sub





小弟写了一个应该是类似你要的东东。
可是,小弟费解为什么用那么麻烦的方法呢?


小弟的愚见是用DATAGRIDVIEW, LISTVIEW 或者 MSFLEXGRID。
如果利用以上的CONTROL 你的TABLE 简单的多了。




[ 本帖最后由 Zhixuen 于 22-9-2007 09:06 AM 编辑 ]
回复

使用道具 举报

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

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


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

GMT+8, 18-9-2025 07:18 AM , Processed in 0.097289 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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