Link to home
Start Free TrialLog in
Avatar of CKirby18
CKirby18Flag for United States of America

asked on

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?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

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?
Avatar of CKirby18

ASKER

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?
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.
Here is the explanation of ScaleMode if it helps:

ScaleMode is not supported
http://msdn.microsoft.com/en-us/library/fhk6kcce(VS.80).aspx

"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).

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?
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great!  Thanks for your help.  What about DrawMode, does it have any significance in .Net or is DrawStyle all that I need?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
You have been incredibly helpful, I really appreciate all of your help