Jump to content

Form ReShaping

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
11 replies to this topic

#1
Genny

Genny

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 203 posts
Hey all, Im new to Programming and trying to learn some neat things about it.

I was wondering how to change the Form shape in Visual Basic 2008 Express Ed. to the shape of an Image. For example, if i have a .BMP or .JPG or if i make one of a shape. How can I make that Shape be the Shape of the Form?

Thanks for the Help.

#2
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Is that possible? I would actually like to accomplish the same in C++ and/or Java... Are you on Windows? (Well, probably) Perhaps some API could help us out... I'll check it.
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#3
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
OK. I think you/we should take a look at the following Win32 APIs (Example VB code):

SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

CreatePolygonRgn Lib "gdi32" (ByVal lpPoint As Any, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long

CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long

CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

And some links you should check out:
Creating Custom Shapes for Forms in Windows Forms
VB
Create Forms in Any Shape!
How to make a Round Shape Form - .Net Articles & Samples
How to use GDI+ regions on forms for customized shapes by using Visual Basic .NET or Visual Basic 2005

Not all of these approaches are suitable for beginners, but check it out.

Edited by marwex89, 19 July 2008 - 08:37 AM.

Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#4
adeviss

adeviss

    Newbie

  • Members
  • Pip
  • 2 posts
great , I will use that

#5
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
I'm sure TcM did a tutorial on it sometime. Check the Tutorials section.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#6
Genny

Genny

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 203 posts
thanks for all your replyes, i found a tutorial on how to do it and now wen i insert an image the form takes the shape of it. thanks again to all and great links btw!!

- genny

#7
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Google's a programmer's best friend... :D
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#8
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
A cheap way of doing it is to make the form transparent and make your image as the background, but not transparent. You can do that all in about 2 minutes with the Properties panel.

#9
Genny

Genny

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 203 posts

dargueta said:

A cheap way of doing it is to make the form transparent and make your image as the background, but not transparent. You can do that all in about 2 minutes with the Properties panel.

Ik ^^ I wrote a Tutorial on it heheh

#10
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
lol :D
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#11
Genny

Genny

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 203 posts
koduz for me!! :p

#12
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
Goes to show how much I look at the tutorials section.