Visual Basic implement

Aug 20, 2011 at 8:18 PM

Hi all,

some documentation on how to implement this class in visual basic is good. For example, I want to add the "glass effect" to my form, but I don't know how.

 

Can someone help me?

Developer
Aug 21, 2011 at 12:44 PM

That should be quite easy: simply change the class from which your form derives in your code-behind file (Form1.vb for instance). In VB you should have something like:

Public Class Form1 Inherits Form

 Change the class from the default Form to the custom WindowsFormsAero.Dwm.Helpers.GlassForm class:

Public Class Form1 Inherits WindowsFormsAero.Dwm.Helpers.GlassForm

 That should be enough to enable the additional glass properties in the Visual Studio designer. The important properties you might want to change are GlassEnabled (boolean, to enable the glass effect), GlassDesignerMargins (to define the size of the glass margins) HandleMouseMove (to automatically handle window dragging on glass) and HideTitle (to hide the window title).

This should work with the latest version of the library available.

Apr 15, 2012 at 9:02 PM

Hi guys,

I'm using Visual Studio 2010 and VB (.NET Framework version 4).  I've followed the instructions above and am getting a PInvoke error.  If I use a lower version of the .NET Framework, things seem to work fine.

Any comments/help would be appreciated.

Ady

Developer
Apr 16, 2012 at 2:02 AM
ady7970 wrote:

I'm using Visual Studio 2010 and VB (.NET Framework version 4).  I've followed the instructions above and am getting a PInvoke error.  If I use a lower version of the .NET Framework, things seem to work fine.

Hi, could you give us a stacktrace or hint at what feature you are using when the PInvoke error is raised?