|
-
Jun 13th, 2002, 12:35 AM
#1
Form.Height?
I'm trying to move a command button to the buttom of a form, but sounds like I'm having a problem
btnAdd.Location = New Drawing.Point(360, Me.Height - btnAdd.Height)
This way the button will be outside the form, but if I use this code instead, it will work
btnAdd.Location = New Drawing.Point(360, Me.Height - btnAdd.Height - 30)
Why do I have to subtract 30 pixels? is that for the titlebar perhaps?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jun 13th, 2002, 12:27 PM
#2
Hyperactive Member
Here's how I place button on a form using Me.ClientSize as the best way imho:-
Dim btn as New Button
'place on bottom-left
btn.Top = Me.ClientSize.Height - btn.Height
btn.Left = 0
btn.Text = "Bottom"
Me.Controls.Add(btn)
'place on bottom-right
btn = New Button()
btn.Top = Me.ClientSize.Height - btn.Height
btn.Left = Me.ClientSize.Width - btn.Width
btn.Text = "Bottom-Right"
Me.Controls.Add(btn)
'place on top-left
btn = New Button()
btn.Top = 0
btn.Left = 0
btn.Text = "Top-Left"
Me.Controls.Add(btn)
'place on top-right
btn = New Button()
btn.Top = 0
btn.Left = Me.ClientSize.Width - btn.Width
btn.Text = "Top-Right"
Me.Controls.Add(btn)
-
Jun 13th, 2002, 03:50 PM
#3
tnx alot, worked
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jun 20th, 2002, 09:37 PM
#4
Member
This way works
I dont think the way above works try 1 of these insted, which one is just a matter of choice
Dim B As New Button()
Dim P As New PointF(100.0, 100.0)
B.Text = "Button"
B.Location = B.Location.Ceiling(P)
Me.Controls.Add(B)
or
Dim B As New Button()
B.Text = "Button"
B.Location = B.Location.Ceiling(New PointF(100.0, 100.0))
Me.Controls.Add(B)
I know for a fact, these ways work
-
Jun 21st, 2002, 12:00 AM
#5
Member
this is the easiest
i almost forgot this way is the easiest
Dim B As New Button()
B.Text = "Button"
B.Location = New Point(500, 100)
Me.Controls.Add(B)
the other ways use the "ceiling" which rounds "pointf", this way you can just plot with a point.
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
|