(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-03-24 06:50 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - VB Help Form Scrollbars New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
interdpth

Mole
MZM rapist


 





Since: 11-18-05

Last post: 6283 days
Last view: 6283 days
Posted on 02-07-07 12:38 AM Link | Quote
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


(edited by interdpth on 02-06-07 11:49 PM)
Guy Perfect









Since: 11-18-05

Last post: 6285 days
Last view: 6283 days
Posted on 02-08-07 01:04 AM Link | Quote
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

Mole
MZM rapist


 





Since: 11-18-05

Last post: 6283 days
Last view: 6283 days
Posted on 02-08-07 09:56 PM Link | Quote
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.


(edited by interdpth on 02-08-07 03:56 PM)
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6285 days
Last view: 6285 days
Posted on 02-08-07 11:10 PM Link | Quote
Originally posted by interdpth

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



how are you closing it?
interdpth

Mole
MZM rapist


 





Since: 11-18-05

Last post: 6283 days
Last view: 6283 days
Posted on 02-09-07 12:01 AM Link | Quote
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? ._.


(edited by interdpth on 02-08-07 08:07 PM)
(edited by interdpth on 02-09-07 05:41 PM)
(edited by interdpth on 02-10-07 12:33 PM)
Zidane

Koopa








Since: 07-14-06
From: Melbourne, FL

Last post: 6288 days
Last view: 6289 days
Posted on 02-12-07 03:27 PM Link | Quote
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.
Add to favorites | Next newer thread | Next older thread
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.012 seconds; used 373.93 kB (max 451.72 kB)