Advertisement

05.14.2008 at 09:36PM PDT, ID: 23404000
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

resizing forms for different monitor sizes in vb6- how to account for size of the taskbar?

Asked by blackbookcoder2 in Visual Basic Programming

i have been working on resize code for my vb6 project to adapt the forms to any screen size, and I pretty much got it thanks to this code from ark, which i adapted some, one thing I noticed though, it doesn't account for the task bar being different sizes, how can I do that?  Measure the size and location of the taskbar and take that into consideration when resizing my forms?

The whole code piece

========Bas module code==========
Public Type CTRL_SIZE
    ctWidth As Long
    ctHeight As Long
End Type

Public Sub ResizeControls(frmParent As Form, Pos_Prev As CTRL_SIZE, Pos_New As CTRL_SIZE)
   Dim fontRatio As Double
   If frmParent.WindowState = vbMinimized Then
      Pos_New = Pos_Prev
      Exit Sub
   End If
   bFromCode = True
   On Error Resume Next
   Dim RatioX As Double, RatioY As Double
   RatioX = Pos_New.ctWidth / Pos_Prev.ctWidth
   RatioY = Pos_New.ctHeight / Pos_Prev.ctHeight
   SendMessage frmParent.hWnd, WM_SETREDRAW, False, ByVal 0&
   For Each ctrl In frmParent.Controls
       ctrl.Left = Int(ctrl.Left * RatioX)
       ctrl.Top = Int(ctrl.Top * RatioY)
       ctrl.Width = Int(ctrl.Width * RatioX)
       ctrl.Height = Int(ctrl.Height * RatioY)
       fontRatio = RatioY
' or    If RatioX > RatioY Then fontRatio = RatioY Else fontRatio = RatioX
       If fontRatio = 0 Then fontRatio = 1
       ctrl.FontSize = ctrl.FontSize * fontRatio
   Next
   On Error GoTo 0
   SendMessage frmParent.hWnd, WM_SETREDRAW, True, ByVal 0&
   frmParent.Refresh
End Sub

'=======Any form code========
Dim frmSize As CTRL_SIZE

Private Sub Form_Load()
'.................
   frmSize.ctWidth = ScaleWidth
   frmSize.ctHeight = ScaleHeight
End Sub

Private Sub Form_Resize()
   Dim NewSize As CTRL_SIZE
   NewSize.ctWidth = ScaleWidth
   NewSize.ctHeight = ScaleHeight
   ResizeControls Me, frmSize, NewSize
   frmSize = NewSize
End SubStart Free Trial
 
 
[+][-]05.14.2008 at 09:55PM PDT, ID: 21570734

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Sign Up Now!
Solution Provided By: appari
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.15.2008 at 10:04PM PDT, ID: 21580139

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.29.2008 at 10:45PM PDT, ID: 21675480

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628