如下VB代码:
Public Class Form1
    Dim DyLikeDrawLib As New DYD.DYD
    Dim PngPath As String
    Dim PNG As Bitmap
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PngPath = "y:\图片库\0.png" 'PNG图片地址
        PNG = New Bitmap(PngPath)
        DyLikeDrawLib.UserKey = "D" '授权码
        DyLikeDrawLib.DrawBP(Me, PNG, 255) 'DrawBP(要显示的目标窗体,PNG图,透明度)
    End Sub
    Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams
        Get
            Dim cp As CreateParams = MyBase.CreateParams
            cp.ExStyle = cp.ExStyle Or &H80000
            Return cp
        End Get
    End PropertyEnd Class因本人没有学过VB所以也不知VB语法所以请问翻译成C#应该是什么呢?

解决方案 »

  1.   

    信手写的,看不懂也别太较真儿~public class Form1 : Form
    {
    DYD.DYD DyLikeDrawLib =new DYD.DYD();
    string PngPath ;
    Bitmap PNG ;
    private Form1_Load(object sender,EventArgse){
      PngPath = "y:\图片库\0.png" 'PNG图片地址;
      PNG = New Bitmap(PngPath);
      DyLikeDrawLib.UserKey = "D" //授权码;
      DyLikeDrawLib.DrawBP(Me, PNG, 255) //DrawBP(要显示的目标窗体,PNG图,透明度);
    }...
      

  2.   

    http://www.developerfusion.com/tools/convert/vb-to-csharp/
      

  3.   

     Protected Overloads Overrides ReadOnly Property CreateParams() As CreateParams
      Get
      Dim cp As CreateParams = MyBase.CreateParams
      cp.ExStyle = cp.ExStyle Or &H80000
      Return cp
      End Get
      End Property
    要翻译的就是这个
      

  4.   


    public class Form1 

        DYD.DYD DyLikeDrawLib = new DYD.DYD(); 
        string PngPath; 
        Bitmap PNG; 
        private void // ERROR: Handles clauses are not supported in C# Form1_Load(System.Object sender, System.EventArgs e) 
        { 
            PngPath = "y:\\图片库\\0.png"; 
            //PNG图片地址 
            PNG = new Bitmap(PngPath); 
            DyLikeDrawLib.UserKey = "D"; 
            //授权码 
                //DrawBP(要显示的目标窗体,PNG图,透明度) 
            DyLikeDrawLib.DrawBP(this, PNG, 255); 
        } 
        protected override CreateParams CreateParams { 
            get { 
                CreateParams cp = base.CreateParams; 
                cp.ExStyle = cp.ExStyle | 0x80000; 
                return cp; 
            } 
        }