Convert VB6 "Drawing Styles" to .Net

Does anyone know where I can find some sort of list that would match VB6 "ScaleMode", "DrawWidth", and "DrawStyle" to an equivalent usage in VB.Net?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Bob LearnedConnect With a Mentor Commented:
VB6 DrawStyle:

vbSolid =  0            Solid (default)
vbDash = 1            Dash
 vbDot = 2              Dot
 vbDashDot = 3      Dash - dot
 vbDashDotDot = 4  

               Dim pen As New Pen(Color.Red)

                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDotDot;
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
                pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
Bob LearnedCommented:
1) I don't know of any list, per se.

2) It has been a while since I have used VB6.

3) How would you use those VB6 constructs?
CKirby18Author Commented:
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Bob LearnedCommented:
Without really digging through all that code, explain what it does for you.  Are you do something like drawing an image on a PictureBox, and then using scroll bars to scroll the image that is larger than the form?
CKirby18Author Commented:
I am having to convert someone else's VB6 code to VB.Net.  Their code was used to do what you described.  However, I am unfamiliar with VB6, so I do not know exactly what impact  "ScaleMode", "DrawWidth", and "DrawStyle" had when he called the "Line" and "Print" procedures.  In .Net I am using "DrawLine" on a panel to display the graph.  I am trying make the .Net graph match the original graph as much as possible.  Therefore, I needed to know if there was an equivalent property in .Net to the above described properties in VB6.  I hope this helps, let me know if I need to explain more.
Bob LearnedCommented:
Here is the explanation of ScaleMode if it helps:

ScaleMode is not supported

"In Visual Basic 6.0, the ScaleMode property could be used to change the coordinate system for a form or PictureBox control from the default scale of twips.

Visual Basic 2005 does not support multiple coordinate systems; only pixels are supported. During upgrade, coordinates are automatically converted from twips to pixels; code that sets the ScaleMode property at run time will cause a compilation error and must be modified."

I believe that the DrawMode and DrawStyle can be replicated with the Pen style for the Graphics.DrawString method call (if you are using that).

CKirby18Author Commented:
Thanks, that is helpful.  I am in fact using Graphics.DrawString as well.  Are you aware of any sort of listing that matches a Pen style to a DrawMode and DrawStyle?
CKirby18Author Commented:
Great!  Thanks for your help.  What about DrawMode, does it have any significance in .Net or is DrawStyle all that I need?
Bob LearnedConnect With a Mentor Commented:
Yeah, DrawMode is not that straight-forward:

vbBlackness 1 Black
vbNotMergePen 2 Not Merge pen
vbMaskNotPen 3 Mask Not pen
vbNotCopyPen 4 Not Copy pen
vbMaskPenNot 5 Mask pen Not
vbInvert 6 Invert
vbXorPen 7 Xor pen
vbNotMaskPen 8 Not Mask pen
vbMaskPen 9 Mask pen
vbNotXorPen 10 Not Xor pen
vbNop 11 No operation; output remains unchanged
vbMergeNotPen 12 Merge Not pen
vbCopyPen 13 Copy pen
vbMergePenNot 14 Merge pen Not
vbMergePen 15 Merge pen
vbWhiteness 16 White

DrawStyle Property
vbSolid 0 Solid
vbDash 1 Dash
vbDot 2 Dot
vbDashDot 3 Dash-dot
vbDashDotDot 4 Dash-dot-dot
vbInvisible 5 Invisible
vbInsideSolid 6 Inside solid
Bob LearnedCommented:
There is not a direct correlation between VB6 DrawMode and VB.NET, so you will have to look at each case, and see what the "best" approach would be.
CKirby18Author Commented:
You have been incredibly helpful, I really appreciate all of your help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.