|
-
Oct 12th, 2000, 12:46 PM
#1
Thread Starter
Lively Member
1. Does anyone have the code for centering forms on screens with different resolutions?
2. I could still use some help on scrolling code as well
http://<br />
<a rel="nofollow" hre...4942</a><br />
Flint
-
Oct 12th, 2000, 12:57 PM
#2
formabc.Top = (Screen.Height - Me.Height) / 2
formabc.Left = (Screen.Width - Me.Width) / 2
Hope it help
-
Oct 12th, 2000, 01:04 PM
#3
Lively Member
Isn't there a Property???
I thought in VB6 and above have a property which u can set the start location of the window. I can't remember the property.
I would check for u but I'm at school <:).
-Justin
-
Oct 12th, 2000, 01:30 PM
#4
Fanatic Member
Chemically Formulated As:
Dr. Nitro
-
Oct 12th, 2000, 01:44 PM
#5
Frenzied Member
I use a module with the following subroutine
Code:
Public Sub Center(frmMe As Form)
' center the form
frmMe.Top = (Screen.Height - frmMe.Height) / 2
frmMe.Left = (Screen.Width - frmMe.Width) / 2
End Sub
and in my Form_Load subroutine I have the line
BTW, dragonyian, your answer is true only when formabc and Me are the same form.
-
Oct 12th, 2000, 01:49 PM
#6
Ya, i saw it when i posted it.. i think that will work... by the way, can anypone help me with this
y = 0.01
do while y <1
y = y*10
loop
text1.text = y
i wonder why the answer is 9.99 but not 1
-
Oct 12th, 2000, 01:55 PM
#7
transcendental analytic
Are you using a floating point for y?
That would cause someoperations to get inexact...
now why don't you keep this on this thread
http://forums.vb-world.net/showthrea...threadid=35076
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 12th, 2000, 06:07 PM
#8
Thread Starter
Lively Member
SUB-TITLE: Y varible math
Thanx ccoder. That's what I was lookin for!
I will try your suggestion nitro.
Dragonyian: The
does not allow the y varible to become 1. Your code continues to multiply y(0.01) * 10 until the value of y = .99
take .99 * 10 and you get 9.99
hope this helps
Flint
A man will pay $2 for a $1 item he wants. A woman will pay $1 for a $2 item that she doesn't want.
-
Oct 12th, 2000, 06:39 PM
#9
Frenzied Member
A slight twist on ccoder's code...
I like ccoder's code, but using the move method lets you take care of top, left, width, and height all in one call.
Using a With statement saves a little processing time.
Code:
Public Sub CenterForm(frmIn As Form)
' Purpose: Centers form on screen
' Usage: CenterForm(Me)
' Note: Usually put in Form_Load or Form_Activate events
With frmIn
.Move (Screen.Width - .Width) / 2, (Screen.Height - .Height) / 2
End With
End Sub
Dragonian, try this instead
Code:
y = 0.01
Do While y <= 1
y = y * 10
Loop
text1.Text = y
Hope that helps!
-
Oct 13th, 2000, 10:13 AM
#10
Thread Starter
Lively Member
Thank you seaweed. (Somehow I never thought I'd say that...lol)
I will certainly give your code a go.
Of course, I expect my code to be running on a minimum of PII 300mhz or better.
Hmmmm....I wonder If I need to include any ocx files in the installation because the app will primarily be used on laptops. Trial and Error shall tell.
Flint
Experience is often what you get when you were
expecting something else.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|