Ben

Ben

  • NA
  • 159
  • 0

VB to C# problem

May 6 2004 4:18 PM
Hello, I hope I posted this in the correct forum... I am no good at translating code from one language to another. can anyone translate the following code from VB to C#? I would really appreciate it. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) _ As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, _ ByVal nIndex As Long) _ As Long Private Declare Function UpdateWindow Lib "user32" (ByVal hwnd As Long) As Long Private Const GWL_EXSTYLE = (-20) Private Const WS_EX_TRANSPARENT = &H20& Private Sub Form_Load() Dim hStyle As Long hStyle = GetWindowLong(RichTextBox1.hwnd, GWL_EXSTYLE) Call SetWindowLong(RichTextBox1.hwnd, GWL_EXSTYLE, hStyle Or WS_EX_TRANSPARENT) Call UpdateWindow(RichTextBox1.hwnd) End Sub Thank you so very much!

Answers (2)