Allow the User to Resize Controls at Runtime
-
Hi, I was looking for information about resize User Control, and I have found this very usefull article Allow the User to Resize Controls at Runtime I must said this is very good :thumbsup:!!!, but there are some updates, and I was trying to probe it, but I have an error, and I have no idea... The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?
Private Sub mControl_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles mControl.MouseDown
CreateQuiz.QuizDesignPanel.Refresh()
mouseX = e.X
mouseY = e.Y
If e.Button = Windows.Forms.MouseButtons.Left Then
mMouseDown = True
CreateQuiz.ControlCreativePanel.Visible = False
CreateQuiz.PicCreativePanel.Visible = False
CreateQuiz.PanelCreativePanel.Visible = False
End If
End SubFull code from Josh-Manson11
Public Class ResizeableControl
Private WithEvents mControl As Control Private mMouseDown As Boolean = False Private mEdge As EdgeEnum = EdgeEnum.None Private mWidth As Integer = 8 Private mOutlineDrawn As Boolean = False Dim mouseX As Integer Dim mouseY As Integer Private Enum EdgeEnum None Right Left Top Bottom Moving BottomRight BottomLeft TopLeft TopRight End Enum Public Sub New(ByVal Control As Control) mControl = Control End Sub Private Sub mControl\_MouseDown(ByVal sender As Object, \_ ByVal e As System.Windows.Forms.MouseEventArgs) \_ Handles mControl.MouseDown CreateQuiz.QuizDesignPanel.Refresh() mouseX = e.X mouseY = e.Y If e.Button = Windows.Forms.MouseButtons.Left Then mMouseDown = True CreateQuiz.ControlCreativePanel.Visible = False CreateQuiz.PicCreativePanel.Visible = False CreateQuiz.PanelCreativePanel.Visible = False End If End Sub Private Sub mControl\_MouseUp(ByVal sender As Object, \_ ByVal e As System.Windows.Forms.MouseEventArgs) \_ Handles mControl.MouseUp mMouseDown = False End Sub Private SelControl As Control Private Sub mControl\_MouseMove(ByVal sender As Object, \_ ByVal e As Syst
-
Hi, I was looking for information about resize User Control, and I have found this very usefull article Allow the User to Resize Controls at Runtime I must said this is very good :thumbsup:!!!, but there are some updates, and I was trying to probe it, but I have an error, and I have no idea... The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?
Private Sub mControl_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles mControl.MouseDown
CreateQuiz.QuizDesignPanel.Refresh()
mouseX = e.X
mouseY = e.Y
If e.Button = Windows.Forms.MouseButtons.Left Then
mMouseDown = True
CreateQuiz.ControlCreativePanel.Visible = False
CreateQuiz.PicCreativePanel.Visible = False
CreateQuiz.PanelCreativePanel.Visible = False
End If
End SubFull code from Josh-Manson11
Public Class ResizeableControl
Private WithEvents mControl As Control Private mMouseDown As Boolean = False Private mEdge As EdgeEnum = EdgeEnum.None Private mWidth As Integer = 8 Private mOutlineDrawn As Boolean = False Dim mouseX As Integer Dim mouseY As Integer Private Enum EdgeEnum None Right Left Top Bottom Moving BottomRight BottomLeft TopLeft TopRight End Enum Public Sub New(ByVal Control As Control) mControl = Control End Sub Private Sub mControl\_MouseDown(ByVal sender As Object, \_ ByVal e As System.Windows.Forms.MouseEventArgs) \_ Handles mControl.MouseDown CreateQuiz.QuizDesignPanel.Refresh() mouseX = e.X mouseY = e.Y If e.Button = Windows.Forms.MouseButtons.Left Then mMouseDown = True CreateQuiz.ControlCreativePanel.Visible = False CreateQuiz.PicCreativePanel.Visible = False CreateQuiz.PanelCreativePanel.Visible = False End If End Sub Private Sub mControl\_MouseUp(ByVal sender As Object, \_ ByVal e As System.Windows.Forms.MouseEventArgs) \_ Handles mControl.MouseUp mMouseDown = False End Sub Private SelControl As Control Private Sub mControl\_MouseMove(ByVal sender As Object, \_ ByVal e As Syst
-
Hi Richard Thank you very much for your reply and your suggestion. The problem is this code not belongs to the autor , for this reason, I ask in the forum, if you believe not is correct, please delete it. Thanks Advanced-
JM76 wrote:
The problem is this code not belongs to the autor
To whom does the code belong, then? Did you write it?
The difficult we do right away... ...the impossible takes slightly longer.
-
JM76 wrote:
The problem is this code not belongs to the autor
To whom does the code belong, then? Did you write it?
The difficult we do right away... ...the impossible takes slightly longer.
-
Hi, I was looking for information about resize User Control, and I have found this very usefull article Allow the User to Resize Controls at Runtime I must said this is very good :thumbsup:!!!, but there are some updates, and I was trying to probe it, but I have an error, and I have no idea... The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?
Private Sub mControl_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles mControl.MouseDown
CreateQuiz.QuizDesignPanel.Refresh()
mouseX = e.X
mouseY = e.Y
If e.Button = Windows.Forms.MouseButtons.Left Then
mMouseDown = True
CreateQuiz.ControlCreativePanel.Visible = False
CreateQuiz.PicCreativePanel.Visible = False
CreateQuiz.PanelCreativePanel.Visible = False
End If
End SubFull code from Josh-Manson11
Public Class ResizeableControl
Private WithEvents mControl As Control Private mMouseDown As Boolean = False Private mEdge As EdgeEnum = EdgeEnum.None Private mWidth As Integer = 8 Private mOutlineDrawn As Boolean = False Dim mouseX As Integer Dim mouseY As Integer Private Enum EdgeEnum None Right Left Top Bottom Moving BottomRight BottomLeft TopLeft TopRight End Enum Public Sub New(ByVal Control As Control) mControl = Control End Sub Private Sub mControl\_MouseDown(ByVal sender As Object, \_ ByVal e As System.Windows.Forms.MouseEventArgs) \_ Handles mControl.MouseDown CreateQuiz.QuizDesignPanel.Refresh() mouseX = e.X mouseY = e.Y If e.Button = Windows.Forms.MouseButtons.Left Then mMouseDown = True CreateQuiz.ControlCreativePanel.Visible = False CreateQuiz.PicCreativePanel.Visible = False CreateQuiz.PanelCreativePanel.Visible = False End If End Sub Private Sub mControl\_MouseUp(ByVal sender As Object, \_ ByVal e As System.Windows.Forms.MouseEventArgs) \_ Handles mControl.MouseUp mMouseDown = False End Sub Private SelControl As Control Private Sub mControl\_MouseMove(ByVal sender As Object, \_ ByVal e As Syst
JM76 wrote:
The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?
That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
JM76 wrote:
The problem is with this code , where I don´t have CreateQuiz. What it is? How to declare this object?
That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Eddy Vluggen wrote:
That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.
Hi Eddy Yes, I tried it, but do not work for me. Thank you very much
-
Eddy Vluggen wrote:
That code did not appear in the article. It looks like someone is trying to hide some panels on a nastily named form. Remove the lines and see if you can resize the control.
Hi Eddy Yes, I tried it, but do not work for me. Thank you very much
-
-
Hi Eddy You are right!!! :) I delete this lines, and delete the Msgbox, and now work very well!!! :thumbsup: As always thank you so much for your help. ;) Regards JM