请问怎样使任意字符串的长度均变为设定的长度?或者说多割少补。(这里的长度指textwidth长度) dim ss as string*30所有的ss都为30个字母或15个文字 保持 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 比如:需要10个字符长度,sub SetToLength(s as string,n as long) if len(s)>n then s=left(s,n) end if if len(s)<n then s=s + space(n-len(s)) end ifend sub 试试format函数,应该可以吧!语法参考MSDN with object1 '例如form1, printer 等 .fontsize = .fontsize * width1 / .textwidth(str1) debug.print .textwidth(str1) '约等于width1end with vb ActiveX 问题,高手进~~~ 笑一笑 高分求助,字段无法被更新?? vb+access 删除临时表时提示错误,请帮忙! 关于SQL连接失败问题,请教各位专家 用代码连接数据库后把结果添加到DataGrid中 怎样将vb中的text输入的内容连接到邮箱呀? 请教高手一个查询问题 各位大瞎救救命! VBA抓取网页数据,需要认证的那种,相关代码,求核对! 制作的安装程序不能在其它计算机中运行 谁给我一个颜色转换的算法(RGB to 256color)
sub SetToLength(s as string,n as long)
if len(s)>n then
s=left(s,n)
end if
if len(s)<n then
s=s + space(n-len(s))
end if
end sub
语法参考MSDN
.fontsize = .fontsize * width1 / .textwidth(str1)
debug.print .textwidth(str1) '约等于width1
end with