Click here to Skip to main content
15,892,005 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: SQL Commands vs VB.net commands Pin
alexrad1-Jul-07 9:25
alexrad1-Jul-07 9:25 
QuestionHow can i open other Form from......... Pin
ankur01011-Jul-07 2:11
ankur01011-Jul-07 2:11 
AnswerRe: How can i open other Form from......... Pin
Tamimi - Code1-Jul-07 2:30
Tamimi - Code1-Jul-07 2:30 
GeneralRe: How can i open other Form from......... Pin
ankur01011-Jul-07 2:36
ankur01011-Jul-07 2:36 
GeneralRe: How can i open other Form from......... Pin
Tamimi - Code1-Jul-07 2:57
Tamimi - Code1-Jul-07 2:57 
GeneralRe: How can i open other Form from......... Pin
ankur01011-Jul-07 20:11
ankur01011-Jul-07 20:11 
GeneralRe: How can i open other Form from......... Pin
ankur01011-Jul-07 20:12
ankur01011-Jul-07 20:12 
QuestionSet Glass around UserControls! Pin
softwarejaeger1-Jul-07 1:43
softwarejaeger1-Jul-07 1:43 
Hello,

i've found a code on this page :http://weblogs.asp.net/kennykerr/archive/2006/08/10/Windows-Vista-for-Developers-_1320_-Part-3-_1320_-The-Desktop-Window-Manager.aspx[^] there's described how to make glass effect, without the known problems with the black controls in the window. But the problem is, the code is written in VC++ and i can't VC++ =(.

How can i do the same in VB.NET?? I've tested a lot, but it doesn't work easyly.

Here's my Code:

Public Class Form1<br />
    <Runtime.InteropServices.DllImport("dwmapi.dll", CharSet:=CharSet.Auto)> _<br />
    Public Shared Sub DwmExtendFrameIntoClientArea(ByVal hWnd As System.IntPtr, ByRef pMargins As Margins)<br />
    End Sub<br />
<br />
    <Runtime.InteropServices.DllImport("dwmapi.dll", CharSet:=CharSet.Auto)> _<br />
    Public Shared Sub DwmIsCompositionEnabled(ByRef IsIt As Boolean)<br />
    End Sub<br />
    <System.Runtime.InteropServices.DllImport("user32.dll")> _<br />
    Private Shared Function SetLayeredWindowAttributes(ByVal hWnd As IntPtr, ByVal crKey As Int32, ByVal bAlpha As Byte, ByVal dwFlags As Int32) As Boolean<br />
    End Function<br />
<br />
    Const COLORREF As Int32 = -65281<br />
    Const LWA_COLORKEY As Int32 = 1<br />
<br />
    Public Structure Margins<br />
        Public Left As Integer<br />
        Public Right As Integer<br />
        Public Top As Integer<br />
        Public Bottom As Integer<br />
    End Structure<br />
    Private inset As Margins = New Margins<br />
<br />
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
        Me.BackColor = Color.FromArgb(COLORREF)<br />
        'Me.TransparencyKey = Color.FromArgb(COLORREF)<br />
<br />
        SetLayeredWindowAttributes(Me.Handle, COLORREF, 80, LWA_COLORKEY)<br />
        Dim marg As New Margins<br />
        marg.Bottom = -1<br />
        marg.Left = -1<br />
        marg.Top = -1<br />
        marg.Right = -1<br />
<br />
        DwmExtendFrameIntoClientArea(Me.Handle, marg)<br />
<br />
    End Sub<br />
End Class


Another code, which do the same and is written in C# i've found on this site: http://weblogs.asp.net/kennykerr/archive/2007/01/23/controls-and-the-desktop-window-manager.aspx[^]

Has somebody any ideas how to do this??? Confused | :confused: Confused | :confused:

Thanks for your help =)
AnswerRe: Set Glass around UserControls! Pin
Paul Conrad13-Jul-07 13:20
professionalPaul Conrad13-Jul-07 13:20 
QuestionCREATE NEW COMPONENT Pin
cheerup_woe1-Jul-07 0:00
cheerup_woe1-Jul-07 0:00 
Questiondatabase question?? Pin
magedhv30-Jun-07 23:35
magedhv30-Jun-07 23:35 
AnswerRe: database question?? Pin
magedhv30-Jun-07 23:36
magedhv30-Jun-07 23:36 
QuestionLogin Dialog Form Pin
Andy20230-Jun-07 22:54
Andy20230-Jun-07 22:54 
AnswerRe: Login Dialog Form Pin
The ANZAC1-Jul-07 2:56
The ANZAC1-Jul-07 2:56 
QuestionReading the data of Datagrids Pin
hsprasain30-Jun-07 21:15
hsprasain30-Jun-07 21:15 
AnswerRe: Reading the data of Datagrids Pin
Tamimi - Code30-Jun-07 21:27
Tamimi - Code30-Jun-07 21:27 
AnswerRe: Reading the data of Datagrids Pin
Guffa30-Jun-07 21:37
Guffa30-Jun-07 21:37 
GeneralRe: Reading the data of Datagrids Pin
hsprasain30-Jun-07 21:42
hsprasain30-Jun-07 21:42 
AnswerRe: Reading the data of Datagrids Pin
Zia Ul Haq Soofi1-Jul-07 9:39
Zia Ul Haq Soofi1-Jul-07 9:39 
QuestionVB ! Pin
mhike1830-Jun-07 16:48
mhike1830-Jun-07 16:48 
AnswerRe: VB ! Pin
Christian Graus30-Jun-07 16:55
protectorChristian Graus30-Jun-07 16:55 
QuestionSave data into a .dat file Pin
atlasliu30-Jun-07 14:38
atlasliu30-Jun-07 14:38 
AnswerRe: Save data into a .dat file Pin
Sathesh Sakthivel30-Jun-07 15:10
Sathesh Sakthivel30-Jun-07 15:10 
GeneralRe: Save data into a .dat file Pin
Paul Conrad24-Dec-07 11:37
professionalPaul Conrad24-Dec-07 11:37 
QuestionCreating Setup with shotcuts Pin
hsprasain30-Jun-07 12:22
hsprasain30-Jun-07 12:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.