Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time
Form not resizing at run-time Form not resizing at run-time
Form not resizing at run-time
Go Back  Xtreme Visual Basic Talk > > > Form not resizing at run-time


Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2012, 03:23 PM
SanganakSakha SanganakSakha is offline
Newcomer
 
Join Date: Jun 2012
Posts: 5
Default Form not resizing at run-time


I have following code to resize the form at run-time but it does not work. Form size remains same. What could be the possible reason?

frmErrMsg.btnNo_Err.Visible = True
frmErrMsg.btnOK_Err.Text = "Yes"

frmErrMsg.Height = 800
frmErrMsg.btnNo_Err.Top = frmErrMsg.Height - 80
frmErrMsg.btnOK_Err.Top = frmErrMsg.Height - 80

frmErrMsg.ShowDialog()
Reply With Quote
  #2  
Old 06-29-2012, 03:24 PM
AtmaWeapon's Avatar
AtmaWeaponForm not resizing at run-time AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Since you just posted a bunch of loose lines of code, I'm going to blame it on "The code is not in an event that is raised after the form has been displayed."
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #3  
Old 07-02-2012, 06:43 PM
dvroman dvroman is offline
Newcomer
 
Join Date: Feb 2008
Location: California
Posts: 6
Default An answer for VB6

Your code appears to be VB, I'm not sure if it's .NET or not. The following is what I use to resize in VB6. In .NET it is not necessary.

Code:
' General
Option Explicit
Dim FRMleft(50) As Integer, FRMtop(50) As Integer
Dim FRMwid(50) As Integer, FRMhite(50) As Integer, FRMcnt As Integer

Private Sub Form_Load()
Dim ctrl As Control
    FRMcnt = 0
    On Error Resume Next
    For Each ctrl In frmMain.Controls
        FRMleft(FRMcnt) = ctrl.Left / frmMain.Width * 100
        FRMtop(FRMcnt) = ctrl.Top / frmMain.Height * 100
        FRMwid(FRMcnt) = ctrl.Width / frmMain.Width * 100
        FRMhite(FRMcnt) = ctrl.Height / frmMain.Height * 100
        FRMcnt = FRMcnt + 1
    Next ctrl
end sub

Private Sub Form_Resize()
Dim ctrl As Control
    FRMcnt = 0
    On Error Resume Next
    For Each ctrl In frmMain.Controls
        ctrl.Left = FRMleft(FRMcnt) * frmMain.Width / 100
        ctrl.Top = FRMtop(FRMcnt) * frmMain.Height / 100
        ctrl.Width = FRMwid(FRMcnt) * frmMain.Width / 100
        ctrl.Height = FRMhite(FRMcnt) * frmMain.Height / 100
        FRMcnt = FRMcnt + 1
    Next ctrl
End Sub
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time Form not resizing at run-time
Form not resizing at run-time
Form not resizing at run-time
 
Form not resizing at run-time
Form not resizing at run-time
 
-->