473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

[VB2003] Moving a form without border

By changing the backgroundimage of a form into a picture and then enable the
TransparencyColor you can make a form as a cirkel etc (the form has the same
'form' as the picture has). I have then disabled the FormBorderStyle (None)

By doing that I have no border I can click at to drag the form. How do I
make the form-area drag-able so that it is possible to click at a random
point at the form, hold down the mousebutton and then move the form?
// Peter
Nov 20 '05 #1
6 4650
"peter hansen" <wo**@tell.you> wrote...
By doing that I have no border I can click at to drag the form. How do I
make the form-area drag-able so that it is possible to click at a random
point at the form, hold down the mousebutton and then move the form?


This should work:

Private _MouseDown As Boolean
Private _MouseX As Integer
Private _MouseY As Integer
Private Sub Form1_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseDown
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

Private Sub Form1_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseMove
If _MouseDown Then
Me.Left = Me.Left + (e.X - _MouseX)
Me.Top = Me.Top + (e.Y - _MouseY)
End If
End Sub

Private Sub Form1_MouseUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseUp
_MouseDown = False
End Sub
Nov 20 '05 #2
* "peter hansen" <wo**@tell.you> scripsit:
By changing the backgroundimage of a form into a picture and then enable the
TransparencyColor you can make a form as a cirkel etc (the form has the same
'form' as the picture has). I have then disabled the FormBorderStyle (None)

By doing that I have no border I can click at to drag the form. How do I
make the form-area drag-able so that it is possible to click at a random
point at the form, hold down the mousebutton and then move the form?


<http://www.google.de/groups?q=sendmessage+HTCAPTION+group:*dotnet*&ie=U TF-8>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Thanks - but why is it - anyway, that sometimes the transparent-thing
doesn't work.
Sometimes it works fine and sometimes it doesn't works.
I only change the BackgroundImage of the form and then set the
TransparencyKey to the color on the Bitmap that I want to make transparent -
in this case #00FFAA
Anyway its a BMP-picture but that shouldn't be the problem cause if I use
the colostandard like 'ControlText' or another color it works fine but if I
change the background into a picture it doesn't works

// Peter
"Tom Leylan" <ge*@iamtiredofspam.com> wrote in message
news:O4*************@TK2MSFTNGP09.phx.gbl...
"peter hansen" <wo**@tell.you> wrote...
By doing that I have no border I can click at to drag the form. How do I
make the form-area drag-able so that it is possible to click at a random
point at the form, hold down the mousebutton and then move the form?


This should work:

Private _MouseDown As Boolean
Private _MouseX As Integer
Private _MouseY As Integer
Private Sub Form1_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseDown
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

Private Sub Form1_MouseMove(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseMove
If _MouseDown Then
Me.Left = Me.Left + (e.X - _MouseX)
Me.Top = Me.Top + (e.Y - _MouseY)
End If
End Sub

Private Sub Form1_MouseUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles
MyBase.MouseUp
_MouseDown = False
End Sub

Nov 20 '05 #4
"peter hansen" <wo**@tell.you> wrote...
Thanks - but why is it - anyway, that sometimes the transparent-thing
doesn't work.
Sometimes it works fine and sometimes it doesn't works.
I only change the BackgroundImage of the form and then set the
TransparencyKey to the color on the Bitmap that I want to make transparent - in this case #00FFAA
Anyway its a BMP-picture but that shouldn't be the problem cause if I use
the colostandard like 'ControlText' or another color it works fine but if I change the background into a picture it doesn't works


Hi Peter... any chance the bitmap doesn't contain a solid color? Just as a
test create another image and simply fill 1/2 of it with your color. If
that works I would suspect the image you were originally using. If it's a
photograph or it has a gradient background for instance not many pixels are
going to match.

Tom

Nov 20 '05 #5

"Tom Leylan" <ge*@iamtiredofspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"peter hansen" <wo**@tell.you> wrote...
Thanks - but why is it - anyway, that sometimes the transparent-thing
doesn't work.
Sometimes it works fine and sometimes it doesn't works.
I only change the BackgroundImage of the form and then set the
TransparencyKey to the color on the Bitmap that I want to make transparent -
in this case #00FFAA
Anyway its a BMP-picture but that shouldn't be the problem cause if I use the colostandard like 'ControlText' or another color it works fine but

if I
change the background into a picture it doesn't works
Hi Peter... any chance the bitmap doesn't contain a solid color? Just as

a test create another image and simply fill 1/2 of it with your color. If
that works I would suspect the image you were originally using. If it's a
photograph or it has a gradient background for instance not many pixels are going to match.


The picture is an octogon created in Illustrator, imported in PhotoShop
where the background has been modified, so that the octagon is the only
viewable area if the TransparentKey is set as the color applied in
PhotoShop. The picture should be used as a splash-screen like when you start
Word or another program with a splash-screen

But it doesn't work... *sigh*

Hmmm... isn't it possible that you would send me an example that works -
eMail:

kian at lflug . [ThisShouldBeRemoved]dk

// Peter
Nov 20 '05 #6

"peter hansen" <wo**@tell.you> wrote in message
news:OK*************@TK2MSFTNGP11.phx.gbl...

"Tom Leylan" <ge*@iamtiredofspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"peter hansen" <wo**@tell.you> wrote...
Thanks - but why is it - anyway, that sometimes the transparent-thing
doesn't work.
Sometimes it works fine and sometimes it doesn't works.
I only change the BackgroundImage of the form and then set the
TransparencyKey to the color on the Bitmap that I want to make transparent -
in this case #00FFAA
Anyway its a BMP-picture but that shouldn't be the problem cause if I use the colostandard like 'ControlText' or another color it works fine but if
I
change the background into a picture it doesn't works


Hi Peter... any chance the bitmap doesn't contain a solid color? Just

as a
test create another image and simply fill 1/2 of it with your color. If
that works I would suspect the image you were originally using. If it's
a photograph or it has a gradient background for instance not many pixels

are
going to match.


The picture is an octogon created in Illustrator, imported in PhotoShop
where the background has been modified, so that the octagon is the only
viewable area if the TransparentKey is set as the color applied in
PhotoShop. The picture should be used as a splash-screen like when you

start Word or another program with a splash-screen

But it doesn't work... *sigh*

Hmmm... isn't it possible that you would send me an example that works -
eMail:

kian at lflug . [ThisShouldBeRemoved]dk

// Peter


Don't ask why but I restarted my computer and then the transparent-thing
worked :D great and thanks anyway :D

// Peter
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matthew Wells | last post by:
I am trying to load a form (load Me) without the form becoming visible. If I try me.hide or me.visible = false, they load the form and the form blinks before becoming invisible. Is there a way to...
11
by: gb | last post by:
Within a form, the usual way of submitting it is to use e.g. <INPUT TYPE="submit" VALUE="Send "> This produces the standard button. Is there an easy way to portray this as though it were a...
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
0
by: TusharP | last post by:
Hi Friends, I have one form having border style none. (Form have irregular shape) This form has number of Dropdown, Textbox and Labels. When Minimized button I resize form to some small value....
4
by: Sumit Gupta | last post by:
Hi Can any one tell me how to move a form without titlebar as we can use WIn API in VB 6.0 is there any other method or xyz for the same Sumit
10
by: Sumit Gupta | last post by:
Hi.. Can anyone please tell me how to move a form (using mouse) if its FormBordestyle is none. i.e form without title bar Sumit
0
by: Brian Tkatch | last post by:
Been trying to figure out how to show borderless forms indside an MDI Form, without showing the border at all. Given that (in our case) only one such form needs to show at a time, we were able...
17
by: michel.ank | last post by:
Hi, I'm using the class PrintLines and my last record of page aren't with the borders. Somebody can help me? Thanks,
3
by: rickllarry | last post by:
Hi I want to remove MDIForm without border .You can move the MDIForm with click its border,however when u select the border as none, u will not be able to move the MDIForm. Does anyone know how to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.