(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-20-24 05:09 PM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - VB Help Form Scrollbars
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
Zidane
Posts: 104/105
Originally posted by interdpth
Like when I go to close my app. It doesn't kill the process.


If you want to program to just end when you close the form, just put "End" under form_unload.
interdpth
Posts: 348/362
I need more help >.<

Ok so my code if the mouse is at a certain point on a label I want the pointer to change
I have the check in a loop based on how many labels I have.

Here's my code

Private Sub picMap_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
Dim my As Integer
Dim mx As Integer
Dim i As Integer
mx = (X \ 16)
my = (Y \ 16)


lblTiled.Caption = Right("000" + Hex(ThisRoom.TileBuf2D(mx, my)), 3)
lblClip.Caption = cboAttribute.List(ThisClipdata.TileBuf2D(mx, my))
lblForeground.Caption = Right("000" + Hex(ThisForeground.TileBuf2D(mx, my)), 3)
lblBacklayer.Caption = Right("000" + Hex(ThisBackLayer.TileBuf2D(mx, my)), 3)
shpThisMap.Move mx * 16, my * 16
shpThisMap.Visible = True
If (EditScroll = True) Then
For i = 0 To Scroll.Number
'Horiz side
' Left of Right of
If (X = lblScroll(i).Left Or X = lblScroll(i).Left + lblScroll(i).Width) Then

Screen.MousePointer = 9 'Horizontal Resize
'Vert side
'Top 'Button
ElseIf (Y = lblScroll(i).Top Or Y = lblScroll(i).Top + lblScroll(i).Height) Then
Screen.MousePointer = 7 ' Vertical
'If the mouse inbetween the scrolls and not touching the border
ElseIf (Y > lblScroll(i).Top And Y < lblScroll(i).Top + lblScroll(i).Height And X > lblScroll(i).Left And X < lblScroll(i).Left + lblScroll(i).Width) Then
Screen.MousePointer = SetCursor(32649&)' Hand
Else
'Else become an arrow
Screen.MousePointer = 1
End If
Next i
End If
If (Button = 1) Then picMap_MouseDown Button, Shift, X, Y
If (Button = 2) Then picMap_MouseDown Button, Shift, X, Y
End Sub

So, help anyone? ._.
never-obsolete
Posts: 78/79
Originally posted by interdpth

Like when I go to close my app. It doesn't kill the process.



how are you closing it?
interdpth
Posts: 347/362
Sweet that worked great!
Mind helping me with some more stuff?

Like when I go to close my app. It doesn't kill the process.

And i'm trying to make a resizeable shape but I have no way to detect the mouse on the shape. Any help there? I'll switch to something else. If it need it.
Guy Perfect
Posts: 446/451
Your problem is probably coming from the fact that a Form's dimensions and the Form's client dimensions are not the same thing. All of a Form's controls go in the client area, and its dimensions are what you should use. If you set the Form's ScaleMode to Pixels, you can get the exact coordinates in the client area via ScaleWidth and ScaleHeight.



So for your code, this is what I recommend:
Private Sub Form_Resize()
On Error Resume Next 'In case you size it too small
hsbMap.Left = 0
hsbMap.Top = ScaleHeight - hsbMap.Height
hsbMap.Width = ScaleWidth - vsbMap.Width
vsbMap.Top = 0
vsbMap.Left = ScaleWidth - vsbMap.Width
vsbMap.Height = ScaleHeight - hsbMap.Height
End Sub
What this will do is set the scroll bars on the right and bottom sides of the Form, regardless of their sizes. It should do what you want to do.
interdpth
Posts: 344/362
Ok, well i'm trying to make a resizeable form that has a vertical scrollbar and a horizontal scrollbar.

Ok, I fixed my last problem, but a new one has arisen. I can get now resize the form and the scrollbars go along with it. But the bigger I make there gets a gap between scroll and form and the bigger the form goes the bigger the gap gets. Anyhelp? here's the code

Private Sub Form_Resize()
hsbMap.Move hsbMap.Left, Round(frmMainMap.Height / 16) - 16
vsbMap.Move Round(frmMainMap.Width / 16) - 16
End Sub
Acmlm's Board - I3 Archive - Programming - VB Help Form Scrollbars


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.002 seconds; used 351.88 kB (max 394.27 kB)