-
Jun 10th, 2009, 05:09 AM
#1
Thread Starter
Addicted Member
A few question
when i try to minimize a form and restore to normal the form is being resize....
It's resize getting extending a form when time to minimizing a form and restore it.
my form is set to formborderstyle is fixedsingle and i'm using namespace.
why is hapening like that...i don't know why
can you help me pls...
Last edited by morkie; Jun 10th, 2009 at 05:14 AM.
-
Jun 10th, 2009, 05:18 AM
#2
Hyperactive Member
Re: A few question
hey morkie
always describe your problem in detail, this description is the only clue for us to give you solution...
what do you mean by auto resize ?
do you think when form is minimized then it will restore in maximized state or else
how you are doing this, may have problem
use FormWindowState to manage this
su ki
* If my post helped you, please Rate it
* If your problem is solved please also mark the thread resolved it is there in right top of page under thread tools
* Why Rating is useful
-
Jun 10th, 2009, 05:25 AM
#3
Thread Starter
Addicted Member
Re: A few question
this is during in runtime...
When form is minimized then restore it by clicking in taskbar( just a normal )
the original size of my form is extended, and try to repeat them twice will keep extended the form...
i don't know why, I'll try to create a normal form with no custom border form and it's work as normal...
But my form with using custom border form using namespace will not working as the normal form....
-
Jun 10th, 2009, 05:30 AM
#4
Re: A few question
So you're using some kind of custom drawing on the form? Do you have any code whatsoever in the eventhandler for the Forms Resize event?
-
Jun 10th, 2009, 05:36 AM
#5
Thread Starter
Addicted Member
Re: A few question
And here's my code:
too long of them
Code:
Namespace Kobush.Windows.Forms
<System.ComponentModel.DesignerCategory("form")> _
Partial Class Form1
Inherits LonghornForm
Public Sub New()
InitializeComponent()
End Sub
Private Sub AxShockWave1()
With swf1
.Play()
.Movie = Application.StartupPath & "\TitleTextBackground 2.swf"
'.Stop()
End With
Swf1.Size = New Size(224, 71)
End Sub
Private Sub MDIFormBackground()
Dim ctl As Control
Dim ctlMDI As MdiClient
' Loop through all of the form's controls looking
' for the control of type MdiClient.
For Each ctl In Me.Controls
Try
' Attempt to cast the control to type MdiClient.
ctlMDI = CType(ctl, MdiClient)
' Set the BackColor of the MdiClient control.
ctlMDI.BackColor = Me.BackColor
Catch exc As InvalidCastException
' Catch and ignore the error if casting failed.
End Try
Next
End Sub
Private Sub PanelBanner_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PanelBanner.MouseDown
PanelBanner.Tag = e.Location
End Sub
Private Sub PanelBanner_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PanelBanner.MouseMove
If e.Button = MouseButtons.Left Then
Dim P As Point = DirectCast(PanelBanner.Tag, Point)
Me.Left += e.Location.X - P.X
Me.Top += e.Location.Y - P.Y
End If
End Sub
-
Jun 10th, 2009, 05:38 AM
#6
Thread Starter
Addicted Member
Re: A few question
Code:
Private Sub Xclose_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Xclose.MouseEnter
With Xclose
.BackgroundImage = My.Resources._Sample2_XClose_Buttons5_hover_
End With
End Sub
Private Sub Xclose_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Xclose.MouseDown
With Xclose
.BackgroundImage = My.Resources._Sample2_XClose_Buttons5_normal_
End With
End Sub
Private Sub Xclose_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Xclose.MouseUp
With Xclose
.BackgroundImage = My.Resources._Sample2_XClose_Buttons5_hover_
End With
End Sub
Private Sub Xclose_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Xclose.MouseLeave
With Xclose
.BackgroundImage = My.Resources._Sample2_XClose_Buttons5_normal_
End With
End Sub
Private Sub Xclose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Xclose.Click
End
End Sub
Private Sub minimizebtn_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles minimizebtn.MouseEnter
With minimizebtn
.BackgroundImage = My.Resources._Sample2_Minimaze_Buttons3_hover_
End With
End Sub
Private Sub minimizebtn_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles minimizebtn.MouseDown
With minimizebtn
.BackgroundImage = My.Resources._Sample2_Minimaze_Buttons3_normal_
End With
End Sub
Private Sub minimizebtn_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles minimizebtn.MouseUp
With minimizebtn
.BackgroundImage = My.Resources._Sample2_Minimaze_Buttons3_hover_
End With
End Sub
Private Sub minimizebtn_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles minimizebtn.MouseLeave
With minimizebtn
.BackgroundImage = My.Resources._Sample2_Minimaze_Buttons3_normal_
End With
End Sub
Private Sub minimizebtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles minimizebtn.Click
Me.WindowState = FormWindowState.Minimized
End Sub
-
Jun 10th, 2009, 05:39 AM
#7
Thread Starter
Addicted Member
Re: A few question
Code:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AxShockWave1()
MDIFormBackground()
Me.StartPosition = FormStartPosition.CenterScreen
End Sub
-
Jun 10th, 2009, 05:41 AM
#8
Thread Starter
Addicted Member
Re: A few question
Code:
Me.components = New System.ComponentModel.Container
Dim DesignerRectTracker1 As CButtonLib.DesignerRectTracker = New CButtonLib.DesignerRectTracker
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Dim CBlendItems1 As CButtonLib.cBlendItems = New CButtonLib.cBlendItems
Dim DesignerRectTracker2 As CButtonLib.DesignerRectTracker = New CButtonLib.DesignerRectTracker
Dim DesignerRectTracker3 As CButtonLib.DesignerRectTracker = New CButtonLib.DesignerRectTracker
Dim CBlendItems2 As CButtonLib.cBlendItems = New CButtonLib.cBlendItems
Dim DesignerRectTracker4 As CButtonLib.DesignerRectTracker = New CButtonLib.DesignerRectTracker
Me.PanelNavigationMenu = New System.Windows.Forms.Panel
Me.Label1 = New System.Windows.Forms.Label
Me.PanelBanner = New System.Windows.Forms.Panel
Me.minimizebtn = New CButtonLib.CButton
Me.Xclose = New CButtonLib.CButton
Me.swf1 = New AxShockwaveFlashObjects.AxShockwaveFlash
Me.PanelNavigationMenu.SuspendLayout()
Me.PanelBanner.SuspendLayout()
CType(Me.swf1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'PanelNavigationMenu
'
Me.PanelNavigationMenu.BackgroundImage = Global.Kobush.Windows.Forms.My.Resources.Resources._Sample2_PanelNavigationMenu7
Me.PanelNavigationMenu.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Me.PanelNavigationMenu.Controls.Add(Me.Label1)
Me.PanelNavigationMenu.Dock = System.Windows.Forms.DockStyle.Left
Me.PanelNavigationMenu.Location = New System.Drawing.Point(0, 100)
Me.PanelNavigationMenu.Name = "PanelNavigationMenu"
Me.PanelNavigationMenu.Size = New System.Drawing.Size(137, 412)
Me.PanelNavigationMenu.TabIndex = 3
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.BackColor = System.Drawing.Color.Transparent
Me.Label1.Font = New System.Drawing.Font("Arial Unicode MS", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.ForeColor = System.Drawing.Color.White
Me.Label1.Location = New System.Drawing.Point(36, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(72, 18)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Navigator"
'
'PanelBanner
'
Me.PanelBanner.BackgroundImage = Global.Kobush.Windows.Forms.My.Resources.Resources._Sample2_PanelBanner5_4
Me.PanelBanner.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Me.PanelBanner.Controls.Add(Me.minimizebtn)
Me.PanelBanner.Controls.Add(Me.Xclose)
Me.PanelBanner.Controls.Add(Me.swf1)
Me.PanelBanner.Dock = System.Windows.Forms.DockStyle.Top
Me.PanelBanner.Location = New System.Drawing.Point(0, 0)
Me.PanelBanner.Name = "PanelBanner"
Me.PanelBanner.Size = New System.Drawing.Size(754, 100)
Me.PanelBanner.TabIndex = 1
-
Jun 10th, 2009, 05:41 AM
#9
Thread Starter
Addicted Member
Re: A few question
Code:
'
'minimizebtn
'
Me.minimizebtn.BackgroundImage = Global.Kobush.Windows.Forms.My.Resources.Resources._Sample2_Minimaze_Buttons3_normal_
DesignerRectTracker1.IsActive = False
DesignerRectTracker1.TrackerRectangle = CType(resources.GetObject("DesignerRectTracker1.TrackerRectangle"), System.Drawing.RectangleF)
Me.minimizebtn.CenterPtTracker = DesignerRectTracker1
CBlendItems1.iColor = New System.Drawing.Color() {System.Drawing.Color.AliceBlue, System.Drawing.Color.RoyalBlue, System.Drawing.Color.Navy}
CBlendItems1.iPoint = New Single() {0.0!, 0.5!, 1.0!}
Me.minimizebtn.ColorFillBlend = CBlendItems1
Me.minimizebtn.ColorFillSolid = System.Drawing.SystemColors.Control
Me.minimizebtn.Corners.All = CType(0, Short)
Me.minimizebtn.Corners.LowerLeft = CType(0, Short)
Me.minimizebtn.Corners.LowerRight = CType(0, Short)
Me.minimizebtn.Corners.UpperLeft = CType(0, Short)
Me.minimizebtn.Corners.UpperRight = CType(0, Short)
Me.minimizebtn.FillType = CButtonLib.CButton.eFillType.GradientLinear
Me.minimizebtn.FillTypeLinear = System.Drawing.Drawing2D.LinearGradientMode.Vertical
Me.minimizebtn.FocalPoints.CenterPtX = 0.4375!
Me.minimizebtn.FocalPoints.CenterPtY = 0.3125!
Me.minimizebtn.FocalPoints.FocusPtX = 0.0!
Me.minimizebtn.FocalPoints.FocusPtY = 0.0!
DesignerRectTracker2.IsActive = False
DesignerRectTracker2.TrackerRectangle = CType(resources.GetObject("DesignerRectTracker2.TrackerRectangle"), System.Drawing.RectangleF)
Me.minimizebtn.FocusPtTracker = DesignerRectTracker2
Me.minimizebtn.Image = Nothing
Me.minimizebtn.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.minimizebtn.ImageIndex = 0
Me.minimizebtn.ImageSize = New System.Drawing.Size(16, 16)
Me.minimizebtn.Location = New System.Drawing.Point(696, 12)
Me.minimizebtn.Name = "minimizebtn"
Me.minimizebtn.Shape = CButtonLib.CButton.eShape.Rectangle
Me.minimizebtn.SideImage = Nothing
Me.minimizebtn.SideImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.minimizebtn.SideImageSize = New System.Drawing.Size(48, 48)
Me.minimizebtn.Size = New System.Drawing.Size(16, 16)
Me.minimizebtn.TabIndex = 3
Me.minimizebtn.Text = ""
Me.minimizebtn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.minimizebtn.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay
Me.minimizebtn.TextMargin = New System.Windows.Forms.Padding(0)
'
'Xclose
'
Me.Xclose.BackgroundImage = Global.Kobush.Windows.Forms.My.Resources.Resources._Sample2_XClose_Buttons5_normal_
DesignerRectTracker3.IsActive = False
DesignerRectTracker3.TrackerRectangle = CType(resources.GetObject("DesignerRectTracker3.TrackerRectangle"), System.Drawing.RectangleF)
Me.Xclose.CenterPtTracker = DesignerRectTracker3
CBlendItems2.iColor = New System.Drawing.Color() {System.Drawing.Color.AliceBlue, System.Drawing.Color.RoyalBlue, System.Drawing.Color.Navy}
CBlendItems2.iPoint = New Single() {0.0!, 0.5!, 1.0!}
Me.Xclose.ColorFillBlend = CBlendItems2
Me.Xclose.ColorFillSolid = System.Drawing.SystemColors.Control
Me.Xclose.Corners.All = CType(0, Short)
Me.Xclose.Corners.LowerLeft = CType(0, Short)
Me.Xclose.Corners.LowerRight = CType(0, Short)
Me.Xclose.Corners.UpperLeft = CType(0, Short)
Me.Xclose.Corners.UpperRight = CType(0, Short)
Me.Xclose.FillType = CButtonLib.CButton.eFillType.GradientLinear
Me.Xclose.FillTypeLinear = System.Drawing.Drawing2D.LinearGradientMode.Vertical
Me.Xclose.FocalPoints.CenterPtX = 0.375!
Me.Xclose.FocalPoints.CenterPtY = 0.25!
Me.Xclose.FocalPoints.FocusPtX = 0.0!
Me.Xclose.FocalPoints.FocusPtY = 0.0!
DesignerRectTracker4.IsActive = False
DesignerRectTracker4.TrackerRectangle = CType(resources.GetObject("DesignerRectTracker4.TrackerRectangle"), System.Drawing.RectangleF)
Me.Xclose.FocusPtTracker = DesignerRectTracker4
Me.Xclose.Image = Nothing
Me.Xclose.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.Xclose.ImageIndex = 0
Me.Xclose.ImageSize = New System.Drawing.Size(16, 16)
Me.Xclose.Location = New System.Drawing.Point(718, 12)
Me.Xclose.Name = "Xclose"
Me.Xclose.Shape = CButtonLib.CButton.eShape.Rectangle
Me.Xclose.SideImage = Nothing
Me.Xclose.SideImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Xclose.SideImageSize = New System.Drawing.Size(48, 48)
Me.Xclose.Size = New System.Drawing.Size(16, 16)
Me.Xclose.TabIndex = 2
Me.Xclose.Text = ""
Me.Xclose.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.Xclose.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay
Me.Xclose.TextMargin = New System.Windows.Forms.Padding(0)
-
Jun 10th, 2009, 05:42 AM
#10
Thread Starter
Addicted Member
Re: A few question
Code:
'
'swf1
'
Me.swf1.Enabled = True
Me.swf1.Location = New System.Drawing.Point(4, 25)
Me.swf1.Name = "swf1"
Me.swf1.OcxState = CType(resources.GetObject("swf1.OcxState"), System.Windows.Forms.AxHost.State)
Me.swf1.Size = New System.Drawing.Size(224, 71)
Me.swf1.TabIndex = 0
Me.swf1.Visible = False
'
'Form1
'
Me.BackgroundImage = Global.Kobush.Windows.Forms.My.Resources.Resources._Sample2_Body
Me.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Me.ClientSize = New System.Drawing.Size(754, 512)
Me.Controls.Add(Me.PanelNavigationMenu)
Me.Controls.Add(Me.PanelBanner)
Me.DoubleBuffered = True
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.IsMdiContainer = True
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.PanelNavigationMenu.ResumeLayout(False)
Me.PanelNavigationMenu.PerformLayout()
Me.PanelBanner.ResumeLayout(False)
CType(Me.swf1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents PanelBanner As System.Windows.Forms.Panel
Friend WithEvents swf1 As AxShockwaveFlashObjects.AxShockwaveFlash
Friend WithEvents PanelNavigationMenu As System.Windows.Forms.Panel
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Xclose As CButtonLib.CButton
Private components As System.ComponentModel.IContainer
Friend WithEvents minimizebtn As CButtonLib.CButton
End Class
End Namespace
-
Jun 10th, 2009, 05:43 AM
#11
Thread Starter
Addicted Member
Re: A few question
sorry for that too long....
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
|