473,656 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[VB2003] Moving a form without border

By changing the backgroundimage of a form into a picture and then enable the
TransparencyCol or 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 4668
"peter hansen" <wo**@tell.yo u> 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.MouseEven tArgs) Handles
MyBase.MouseDow n
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

Private Sub Form1_MouseMove (ByVal sender As Object, _
ByVal e As System.Windows. Forms.MouseEven tArgs) Handles
MyBase.MouseMov e
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(B yVal sender As Object, _
ByVal e As System.Windows. Forms.MouseEven tArgs) Handles
MyBase.MouseUp
_MouseDown = False
End Sub
Nov 20 '05 #2
* "peter hansen" <wo**@tell.yo u> scripsit:
By changing the backgroundimage of a form into a picture and then enable the
TransparencyCol or 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=sendme ssage+HTCAPTION +group:*dotnet* &ie=UTF-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*@iamtiredof spam.com> wrote in message
news:O4******** *****@TK2MSFTNG P09.phx.gbl...
"peter hansen" <wo**@tell.yo u> 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.MouseEven tArgs) Handles
MyBase.MouseDow n
_MouseDown = True
_MouseX = e.X
_MouseY = e.Y
End Sub

Private Sub Form1_MouseMove (ByVal sender As Object, _
ByVal e As System.Windows. Forms.MouseEven tArgs) Handles
MyBase.MouseMov e
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(B yVal sender As Object, _
ByVal e As System.Windows. Forms.MouseEven tArgs) Handles
MyBase.MouseUp
_MouseDown = False
End Sub

Nov 20 '05 #4
"peter hansen" <wo**@tell.yo u> 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*@iamtiredof spam.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
"peter hansen" <wo**@tell.yo u> 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 . [ThisShouldBeRem oved]dk

// Peter
Nov 20 '05 #6

"peter hansen" <wo**@tell.yo u> wrote in message
news:OK******** *****@TK2MSFTNG P11.phx.gbl...

"Tom Leylan" <ge*@iamtiredof spam.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
"peter hansen" <wo**@tell.yo u> 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 . [ThisShouldBeRem oved]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
17061
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 load the form without it becoming visible at all until I say me.visible = true? Thanks. Matthew Wells MWells@NumberCruncher.com
11
12683
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 simple hypertext link? Second question: Is there any way to customize a submit button other than the text that it displays? i.e. can I change the colour and/or size?
14
10127
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 I should give back to the community by posting our findings. Thanks you all for all your help till now by posting problems and their solutions. ~Abhijit
0
1391
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. Now I want to apply my own Scrolled control to see all controls in minimized state. I attach my scrollbar (having diff. look n feel) How to scroll these form controls. Need urgent help.... Thanx in Advance. Tushar P.
4
2050
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
5249
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
1300
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 to put a panel in the (entire) MDI client area and anchor it all around. Then, Show() the panel before opening a form, and after the Form.Show(), do a Panel.Hide(). Panel.BringToFront() and Panel.SendToBack() work just as well. We chose Hide()...
17
2520
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
1797
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 solve this problem ? Thanks rick
0
8380
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1598
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.