在Visual Studio 2008中将Vb6迁移到Vb.net [英] Vb6 to Vb.net migration in visual studio 2008

查看:299
本文介绍了在Visual Studio 2008中将Vb6迁移到Vb.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

apExcel.ActiveCell.MergeArea.RowHeight = _
        apExcel.ActiveSheet.StandardHeight * _
        (Int(frmProd.TextWidth(cInDef) / apExcel.ActiveCell.MergeArea.Width * nScaleFactor) + 1)



.net没有textwidth属性,我该如何转换它.谢谢..



There is no textwidth property for .net how can i convert it thanks..

推荐答案

类似这样的东西(在Google上很容易找到):

Something like this (and easily found on google):

Dim g As Graphics = Me.CreateGraphics()
Dim textSize As Size = g.MeasureString(cInDef, Me.Font).ToSize()

apExcel.ActiveCell.MergeArea.RowHeight = _
        apExcel.ActiveSheet.StandardHeight * _
        (Int(textSize.Width / apExcel.ActiveCell.MergeArea.Width * nScaleFactor) + 1)

g.Dispose()


这些可能包含有用的信息:
-将VB6转换为VB.NET,第一部分 [将VB6转换为VB.NET [ ^ ]
-将VB6升级到VB.NET [
These may contain useful info:
- Converting VB6 to VB.NET, Part I[^]
- Converting VB6 to VB.NET[^]
- Upgrading VB6 to VB.NET[^]


这篇关于在Visual Studio 2008中将Vb6迁移到Vb.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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