تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مشكلة في تحجيم الفورم ؟
#1
انا عندي مشكله في عملية تحجيم الفورم لاني مستخدم الفورم "form : None" وامتلك اداه ميديا بلير , ممكن تطريقة في عملية تغير حجم الفورم ؟
" بالطريقة ذهب الى حدود الفورم ثم سحب لعميله تكبير و تصغير الفورم كما هو معتاد في جميع التطبيقات "

اذا كانت ادوات متوفره في مشروه هيا :
فورم : نان
ميديا بلير
MENU STRIP
الرد }}}
تم الشكر بواسطة:
#2
Public Class Form1


Dim ProportionsArray() As CtrlProportions
Private Structure CtrlProportions
Dim HeightProportions As Single
Dim WidthProportions As Single
Dim TopProportions As Single
Dim LeftProportions As Single
End Structure


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


'Me.TextBox2.Anchor = AnchorStyles.Top And AnchorStyles.Bottom And AnchorStyles.Left And AnchorStyles.Right


Informload()

End Sub

Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize

Resizeform()

End Sub


Sub Informload()

On Error Resume Next

Application.DoEvents()

ReDim ProportionsArray(0 To Controls.Count - 1)

For I As Integer = 0 To Controls.Count - 1

With ProportionsArray(I)
.HeightProportions = Controls(I).Height / Height
.WidthProportions = Controls(I).Width / Width
.TopProportions = Controls(I).Top / Height
.LeftProportions = Controls(I).Left / Width

End With
Next

End Sub

Public Sub Resizeform()

On Error Resume Next

For I As Integer = 0 To Controls.Count - 1

Controls(I).Left = ProportionsArray(I).LeftProportions * Me.Width
Controls(I).Top = ProportionsArray(I).TopProportions * Me.Height
Controls(I).Width = ProportionsArray(I).WidthProportions * Me.Width
Controls(I).Height = ProportionsArray(I).HeightProportions * Me.Height
Next

End Sub
End Class
الرد }}}
تم الشكر بواسطة:
#3
ماسبب وجود TextBox2 في كود
'Me.TextBox2.Anchor = AnchorStyles.Top And AnchorStyles.Bottom And AnchorStyles.Left And AnchorStyles.Right
الرد }}}
تم الشكر بواسطة:
#4
داه تعليق نسيت امسحه مالوش لازمة لو عايز تمسحه امسحه
الرد }}}
تم الشكر بواسطة:
#5
اوك , بس ماضبط معي راح ارفع لك مشروع .... ؟
http://www.mediafire.com/download/6jp4c2...ation2.zip
الرد }}}
تم الشكر بواسطة:
#6
W XP 2003 كتب :انا عندي مشكله في عملية تحجيم الفورم لاني مستخدم الفورم "form : None" وامتلك اداه ميديا بلير , ممكن تطريقة في عملية تغير حجم الفورم ؟
" بالطريقة ذهب الى حدود الفورم ثم سحب لعميله تكبير و تصغير الفورم كما هو معتاد في جميع التطبيقات "

اذا كانت ادوات متوفره في مشروه هيا :
فورم : نان
ميديا بلير
MENU STRIP


السلام عليكم ورحمة الله وبركاته





بحسب ما فهمت، هذا هو ما تحتاجه فقط

PHP كود :
Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgsHandles MyBase.Load
    Me
.FormBorderStyle Windows.Forms.FormBorderStyle.Sizable
    Me
.ControlBox False
    Me
.Text ""
End Sub

Private Sub ControlMouseMoving(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgsHandles Me.MouseMove
    
Static xxyy As Integer
    
If e.Button Windows.Forms.MouseButtons.Left Then
        sender
.Location = New Point(sender.Location.e.xxsender.Location.e.yy)
    Else
        
xx e.yy e.Y
    End 
If
End Sub 





السلام عليكم ورحمة الله وبركاته
الرد }}}
تم الشكر بواسطة:
#7
اهلا يااخي @@أبورائد@@
كودك جميل جدااا ولكن مشكله انه راح يخرب شكل الفورم الى انا عامله , ولكن اهل استطيع ان اجعل الحدود الظاهره لتغير تحجيم الفورم ,,, تظهر و تختفي اي انها تظهر في حال مأشر موس يكون في نهاية الفورم تكبير و تصغير و يختفي الحدود في حال ابتعاده ماشر موس عم حدود الفورم .؟ ممكن ذلك
الرد }}}
تم الشكر بواسطة:
#8

السلام عليكم ورحمة الله وبركاته





تفضل


PHP كود :
Public Class Form1

    
Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgsHandles MyBase.Load

        ResizeSeup
()

    
End Sub

#Region " Resize "
    
Private Sub ResizeSeup()
        
Me.FormBorderStyle Windows.Forms.FormBorderStyle.None
        AddHandler Me
.MouseMoveAddressOf ControlMouseMoving
        Dim LabelLeftWidth 
As New Label
        Dim LabelTopHeight 
As New Label
        Dim LabelRightWidth 
As New Label
        Dim LabelBottomHeight 
As New Label
        Dim LabelRightBottom 
As New Label
        Dim LabelLeftBottom 
As New Label
        Dim LabelRightTop 
As New Label
        Dim LabelLeftTop 
As New Label
        LabelLeftWidth
.Dock DockStyle.Left
        LabelTopHeight
.Dock DockStyle.Top
        LabelRightWidth
.Dock DockStyle.Right
        LabelBottomHeight
.Dock DockStyle.Bottom
        LabelRightBottom
.Anchor AnchorStyles.Right Or AnchorStyles.Bottom
        LabelLeftBottom
.Anchor AnchorStyles.Left Or AnchorStyles.Bottom
        LabelRightTop
.Anchor AnchorStyles.Right Or AnchorStyles.Top
        LabelLeftTop
.Anchor AnchorStyles.Left Or AnchorStyles.Top
        LabelLeftWidth
.Width 6
        LabelTopHeight
.Height 6
        LabelRightWidth
.Width 6
        LabelBottomHeight
.Height 6
        LabelRightBottom
.Size = New Size(66)
        
LabelLeftBottom.Size = New Size(66)
        
LabelRightTop.Size = New Size(66)
        
LabelLeftTop.Size = New Size(66)
        
LabelRightBottom.Location = New Point(Me.Width LabelRightBottom.WidthMe.Height LabelRightBottom.Height)
        
LabelLeftBottom.Location = New Point(0Me.Height LabelLeftBottom.Height)
        
LabelRightTop.Location = New Point(Me.Width LabelRightTop.Width0)
        
LabelLeftTop.Location = New Point(00)
        
LabelLeftWidth.Cursor Cursors.SizeWE
        LabelTopHeight
.Cursor Cursors.SizeNS
        LabelRightWidth
.Cursor Cursors.SizeWE
        LabelBottomHeight
.Cursor Cursors.SizeNS
        LabelRightBottom
.Cursor Cursors.SizeNWSE
        LabelLeftBottom
.Cursor Cursors.SizeNESW
        LabelRightTop
.Cursor Cursors.SizeNESW
        LabelLeftTop
.Cursor Cursors.SizeNWSE
        AddHandler LabelLeftWidth
.MouseMoveAddressOf LabelLeftWidth_MouseMove
        AddHandler LabelTopHeight
.MouseMoveAddressOf LabelTopHeight_MouseMove
        AddHandler LabelRightWidth
.MouseMoveAddressOf LabelRightWidth_MouseMove
        AddHandler LabelBottomHeight
.MouseMoveAddressOf LabelBottomHeight_MouseMove
        AddHandler LabelRightBottom
.MouseMoveAddressOf LabelRightBottom_MouseMove
        AddHandler LabelLeftBottom
.MouseMoveAddressOf LabelLeftBottom_MouseMove
        AddHandler LabelRightTop
.MouseMoveAddressOf LabelRightTop_MouseMove
        AddHandler LabelLeftTop
.MouseMoveAddressOf LabelLeftTop_MouseMove
        Me
.Controls.Add(LabelLeftWidth)
        
Me.Controls.Add(LabelTopHeight)
        
Me.Controls.Add(LabelRightWidth)
        
Me.Controls.Add(LabelBottomHeight)
        
Me.Controls.Add(LabelRightBottom)
        
Me.Controls.Add(LabelLeftBottom)
        
Me.Controls.Add(LabelRightTop)
        
Me.Controls.Add(LabelLeftTop)
        
LabelRightBottom.SendToBack()
        
LabelLeftBottom.SendToBack()
        
LabelRightTop.SendToBack()
        
LabelLeftTop.SendToBack()
        
LabelLeftWidth.SendToBack()
        
LabelTopHeight.SendToBack()
        
LabelRightWidth.SendToBack()
        
LabelBottomHeight.SendToBack()
    
End Sub
    
Private Sub ControlMouseMoving(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
xxyy As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            sender
.Location = New Point(sender.Location.e.xxsender.Location.e.yy)
        Else
            
xx e.yy e.Y
        End 
If
    
End Sub
    
Private Sub LabelRightWidth_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
xx As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Width Me.Width e.xx
        
Else
            
xx e.X
        End 
If
    
End Sub
    
Private Sub LabelBottomHeight_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
yy As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Height Me.Height e.yy
        
Else
            
yy e.Y
        End 
If
    
End Sub
    
Private Sub LabelLeftWidth_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
xx As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Left Me.Left e.xx
            Me
.Width Me.Width e.xx
        
Else
            
xx e.X
        End 
If
    
End Sub
    
Private Sub LabelTopHeight_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
yy As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Top Me.Top e.yy
            Me
.Height Me.Height e.yy
        
Else
            
yy e.Y
        End 
If
    
End Sub
    
Private Sub LabelRightBottom_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
xxyy As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Width Me.Width e.xx
            Me
.Height Me.Height e.yy
        
Else
            
xx e.X
            yy 
e.Y
        End 
If
    
End Sub
    
Private Sub LabelLeftBottom_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
xxyy As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Left Me.Left e.xx
            Me
.Width Me.Width e.xx
            Me
.Height Me.Height e.yy
        
Else
            
xx e.X
            yy 
e.Y
        End 
If
    
End Sub
    
Private Sub LabelRightTop_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
xxyy As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Width Me.Width e.xx
            Me
.Top Me.Top e.yy
            Me
.Height Me.Height e.yy
        
Else
            
xx e.X
            yy 
e.Y
        End 
If
    
End Sub
    
Private Sub LabelLeftTop_MouseMove(ByVal sender As ObjectByVal e As System.Windows.Forms.MouseEventArgs)
        Static 
xxyy As Integer
        
If e.Button Windows.Forms.MouseButtons.Left Then
            Me
.Left Me.Left e.xx
            Me
.Width Me.Width e.xx
            Me
.Top Me.Top e.yy
            Me
.Height Me.Height e.yy
        
Else
            
xx e.X
            yy 
e.Y
        End 
If
    
End Sub
#End Region

End Class 





السلام عليكم ورحمة الله وبركاته
الرد }}}
تم الشكر بواسطة:
#9
انا اسف جدا واضح انك شغال فيجوال بيسك دوت نت 2012 وانا شغال بـ2010 فامشهدر اسعدك وانشاء الله @@أبورائد@@ الكود بتاعه يكون نفع معاك
الرد }}}
تم الشكر بواسطة:
#10
شكرا لكم جميعااا ,االله يعطيكم العافية
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم