Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,902 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,218 people online right now. Registration is fast and FREE... Join Now!




Help me in vb 2005 express edition

 
Reply to this topicStart new topic

Help me in vb 2005 express edition, 2005 express

Dracitus
19 Jan, 2008 - 09:29 AM
Post #1

New D.I.C Head
*

Joined: 19 Jan, 2008
Posts: 3

He me im lost i need a object to act like a barrier but i cant seem to figure it out im useing code like this



CODE
  Dim Loc As Point
        Select Case e.KeyCode
            Case Keys.Left
                If Not picPlayer.Location.X - 5 < 0 Then
                    Loc = New Point(picPlayer.Location.X - 5, picPlayer.Location.Y)
                    picPlayer.Location = Loc
                End If
            Case Keys.Right
                If Not picPlayer.Location.X + 5 > Me.Width - picPlayer.Width - 5 Then
                    Loc = New Point(picPlayer.Location.X + 5, picPlayer.Location.Y)
                    picPlayer.Location = Loc
                End If
            Case Keys.Up
                If Not picPlayer.Location.Y - 5 < 0 Then
                    Loc = New Point(picPlayer.Location.X, picPlayer.Location.Y - 5)
                    picPlayer.Location = Loc
                End If
            Case Keys.Down
                If Not picPlayer.Location.Y - 5 > Me.Height - picPlayer.Height * 1.5 Then
                    Loc = New Point(picPlayer.Location.X, picPlayer.Location.Y + 5)
                    picPlayer.Location = Loc
                End If
        End Select




Please help i can go to the edgeg of the form and itll stop but if i put a buton on the form i go through the button basicly i want the button to ack like a border nd when i hiit the edge of the button on all sides (i would not wnt to go through it just stop)


Plz email me at j.a.carley@hotmail.com
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Help Me In Vb 2005 Express Edition
19 Jan, 2008 - 10:09 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Well you need to get the bounds of the form then make sure the button don't let the button move past that point.

Also, Express Edition is VB.Net so Im moving it to the proper forum smile.gif
User is online!Profile CardPM
+Quote Post

Dracitus
RE: Help Me In Vb 2005 Express Edition
19 Jan, 2008 - 02:45 PM
Post #3

New D.I.C Head
*

Joined: 19 Jan, 2008
Posts: 3

QUOTE(PsychoCoder @ 19 Jan, 2008 - 11:09 AM) *

Well you need to get the bounds of the form then make sure the button don't let the button move past that point.

Also, Express Edition is VB.Net so Im moving it to the proper forum smile.gif




Thanks sorry
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 01:18PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month