-1
I have a problem! When I try to move my program to some other place on the screen, I can’t, it seems to be fixed. Does anyone know how to solve?
@PS: I tried this code provided by Roberto and it didn’t work.
Public Class Form1
Private WM_NCHITTEST As Integer = &H84
Private HTCLIENT As Integer = &H1
Private HTCAPTION As Integer = &H2
Protected Overrides Sub WndProc(ByRef m As Message)
MyBase.WndProc(m)
Select Case m.Msg
Case WM_NCHITTEST
If m.Result = New IntPtr(HTCLIENT) Then
m.Result = New IntPtr(HTCAPTION)
End If
End Select
The title bar of the form has been removed so that a custom design is used in its place so that the drag form feature by clicking on its title bar has been lost.
Code Form1.Designer.Vb :
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.header = New System.Windows.Forms.Panel
Me.PictureBox10 = New System.Windows.Forms.PictureBox
Me.PictureBox8 = New System.Windows.Forms.PictureBox
Me.PictureBox3 = New System.Windows.Forms.PictureBox
Me.body = New System.Windows.Forms.Panel
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Label7 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.PictureBox9 = New System.Windows.Forms.PictureBox
Me.Label5 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.PictureBox7 = New System.Windows.Forms.PictureBox
Me.PictureBox6 = New System.Windows.Forms.PictureBox
Me.PictureBox5 = New System.Windows.Forms.PictureBox
Me.PictureBox4 = New System.Windows.Forms.PictureBox
Me.PictureBox2 = New System.Windows.Forms.PictureBox
Me.bemvindo = New System.Windows.Forms.Label
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.ErrorProvider1 = New System.Windows.Forms.ErrorProvider(Me.components)
Me.Label8 = New System.Windows.Forms.Label
Me.header.SuspendLayout()
CType(Me.PictureBox10, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox8, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit()
Me.body.SuspendLayout()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox6, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ErrorProvider1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'header
'
Me.header.BackColor = System.Drawing.Color.FromArgb(CType(CType(51, Byte), Integer), CType(CType(153, Byte), Integer), CType(CType(204, Byte), Integer))
Me.header.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.header.Controls.Add(Me.PictureBox10)
Me.header.Controls.Add(Me.PictureBox8)
Me.header.Controls.Add(Me.PictureBox3)
Me.header.Dock = System.Windows.Forms.DockStyle.Top
Me.header.Location = New System.Drawing.Point(0, 0)
Me.header.Name = "header"
Me.header.Size = New System.Drawing.Size(575, 46)
Me.header.TabIndex = 0
'
'PictureBox10
'
Me.PictureBox10.Image = Global.AssistenteFdF.My.Resources.Resources.hruonXC
Me.PictureBox10.Location = New System.Drawing.Point(506, 3)
Me.PictureBox10.Name = "PictureBox10"
Me.PictureBox10.Size = New System.Drawing.Size(34, 35)
Me.PictureBox10.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox10.TabIndex = 2
Me.PictureBox10.TabStop = False
'
'PictureBox8
'
Me.PictureBox8.Image = Global.AssistenteFdF.My.Resources.Resources.vdc7y0T
Me.PictureBox8.Location = New System.Drawing.Point(532, 4)
Me.PictureBox8.Name = "PictureBox8"
Me.PictureBox8.Size = New System.Drawing.Size(34, 35)
Me.PictureBox8.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox8.TabIndex = 1
Me.PictureBox8.TabStop = False
'
'PictureBox3
'
Me.PictureBox3.Image = Global.AssistenteFdF.My.Resources.Resources.INS1aq9
Me.PictureBox3.Location = New System.Drawing.Point(11, 8)
Me.PictureBox3.Name = "PictureBox3"
Me.PictureBox3.Size = New System.Drawing.Size(316, 34)
Me.PictureBox3.TabIndex = 0
Me.PictureBox3.TabStop = False
'
'body
'
Me.body.BackColor = System.Drawing.Color.White
Me.body.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.body.Controls.Add(Me.Label8)
Me.body.Controls.Add(Me.PictureBox1)
Me.body.Controls.Add(Me.Label7)
Me.body.Controls.Add(Me.Label6)
Me.body.Controls.Add(Me.PictureBox9)
Me.body.Controls.Add(Me.Label5)
Me.body.Controls.Add(Me.Label4)
Me.body.Controls.Add(Me.Label3)
Me.body.Controls.Add(Me.Label2)
Me.body.Controls.Add(Me.Label1)
Me.body.Controls.Add(Me.PictureBox7)
Me.body.Controls.Add(Me.PictureBox6)
Me.body.Controls.Add(Me.PictureBox5)
Me.body.Controls.Add(Me.PictureBox4)
Me.body.Controls.Add(Me.PictureBox2)
Me.body.Controls.Add(Me.bemvindo)
Me.body.Dock = System.Windows.Forms.DockStyle.Fill
Me.body.Location = New System.Drawing.Point(0, 46)
Me.body.Name = "body"
Me.body.Size = New System.Drawing.Size(575, 311)
Me.body.TabIndex = 1
'
'PictureBox1
'
Me.PictureBox1.Image = Global.AssistenteFdF.My.Resources.Resources.sl6Iv9x
Me.PictureBox1.Location = New System.Drawing.Point(408, 207)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(158, 100)
Me.PictureBox1.TabIndex = 15
Me.PictureBox1.TabStop = False
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Font = New System.Drawing.Font("Arial Narrow", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.Location = New System.Drawing.Point(2, 274)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(355, 20)
Me.Label7.TabIndex = 14
Me.Label7.Text = "Desenvolvido pela equipe de suporte Forumeiros © 2015" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.Location = New System.Drawing.Point(437, 145)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(71, 28)
Me.Label6.TabIndex = 13
Me.Label6.Text = "Mensagens" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "pré-definidas"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'PictureBox9
'
Me.PictureBox9.Image = Global.AssistenteFdF.My.Resources.Resources.Done2
Me.PictureBox9.Location = New System.Drawing.Point(447, 81)
Me.PictureBox9.Name = "PictureBox9"
Me.PictureBox9.Size = New System.Drawing.Size(57, 61)
Me.PictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox9.TabIndex = 12
Me.PictureBox9.TabStop = False
Me.ToolTip1.SetToolTip(Me.PictureBox9, "Mensagens pré-definidas")
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(377, 145)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(42, 28)
Me.Label5.TabIndex = 11
Me.Label5.Text = "Mover" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "tópicos"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(289, 145)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(67, 28)
Me.Label4.TabIndex = 10
Me.Label4.Text = "Visualizador" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "HTML"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(213, 145)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(65, 42)
Me.Label3.TabIndex = 9
Me.Label3.Text = "Perguntas e" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "respostas" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "frequentes"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(139, 145)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(64, 28)
Me.Label2.TabIndex = 8
Me.Label2.Text = "MP de" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "advertência"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(59, 145)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(66, 28)
Me.Label1.TabIndex = 7
Me.Label1.Text = "Mensagens " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "moderativas"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'PictureBox7
'
Me.ErrorProvider1.SetError(Me.PictureBox7, "[ERRO] Função indisponivel")
Me.ErrorProvider1.SetIconAlignment(Me.PictureBox7, System.Windows.Forms.ErrorIconAlignment.BottomRight)
Me.ErrorProvider1.SetIconPadding(Me.PictureBox7, -15)
Me.PictureBox7.Image = Global.AssistenteFdF.My.Resources.Resources.folder_move_icon
Me.PictureBox7.Location = New System.Drawing.Point(371, 81)
Me.PictureBox7.Name = "PictureBox7"
Me.PictureBox7.Size = New System.Drawing.Size(57, 61)
Me.PictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox7.TabIndex = 5
Me.PictureBox7.TabStop = False
Me.ToolTip1.SetToolTip(Me.PictureBox7, "Mover tópicos (função indisponível)")
'
'PictureBox6
'
Me.PictureBox6.Image = Global.AssistenteFdF.My.Resources.Resources.HTML_File_Extension
Me.PictureBox6.Location = New System.Drawing.Point(294, 81)
Me.PictureBox6.Name = "PictureBox6"
Me.PictureBox6.Size = New System.Drawing.Size(57, 61)
Me.PictureBox6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox6.TabIndex = 4
Me.PictureBox6.TabStop = False
Me.ToolTip1.SetToolTip(Me.PictureBox6, "Visualizador HTML")
'
'PictureBox5
'
Me.PictureBox5.Image = Global.AssistenteFdF.My.Resources.Resources.tez
Me.PictureBox5.Location = New System.Drawing.Point(216, 81)
Me.PictureBox5.Name = "PictureBox5"
Me.PictureBox5.Size = New System.Drawing.Size(57, 61)
Me.PictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox5.TabIndex = 3
Me.PictureBox5.TabStop = False
Me.ToolTip1.SetToolTip(Me.PictureBox5, "Perguntas e respostas frequentes")
'
'PictureBox4
'
Me.PictureBox4.Image = Global.AssistenteFdF.My.Resources.Resources.metroui_other_mail_icon
Me.PictureBox4.Location = New System.Drawing.Point(142, 81)
Me.PictureBox4.Name = "PictureBox4"
Me.PictureBox4.Size = New System.Drawing.Size(57, 61)
Me.PictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox4.TabIndex = 2
Me.PictureBox4.TabStop = False
Me.ToolTip1.SetToolTip(Me.PictureBox4, "Enviar MP de advertência")
'
'PictureBox2
'
Me.PictureBox2.BackColor = System.Drawing.Color.White
Me.PictureBox2.Image = Global.AssistenteFdF.My.Resources.Resources.icon_help
Me.PictureBox2.Location = New System.Drawing.Point(62, 81)
Me.PictureBox2.Name = "PictureBox2"
Me.PictureBox2.Size = New System.Drawing.Size(57, 61)
Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBox2.TabIndex = 1
Me.PictureBox2.TabStop = False
Me.ToolTip1.SetToolTip(Me.PictureBox2, "Mensagens moderativas")
'
'bemvindo
'
Me.bemvindo.AutoSize = True
Me.bemvindo.Font = New System.Drawing.Font("Arial Narrow", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.bemvindo.Location = New System.Drawing.Point(32, 10)
Me.bemvindo.Name = "bemvindo"
Me.bemvindo.Size = New System.Drawing.Size(516, 23)
Me.bemvindo.TabIndex = 0
Me.bemvindo.Text = "Bem-vindo ao assistente de moderação do fórum de suporte Forumeiros!" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)
'
'ToolTip1
'
Me.ToolTip1.AutomaticDelay = 0
Me.ToolTip1.AutoPopDelay = 5000
Me.ToolTip1.BackColor = System.Drawing.SystemColors.ControlText
Me.ToolTip1.ForeColor = System.Drawing.SystemColors.Control
Me.ToolTip1.InitialDelay = 0
Me.ToolTip1.IsBalloon = True
Me.ToolTip1.ReshowDelay = 100
Me.ToolTip1.UseAnimation = False
Me.ToolTip1.UseFading = False
'
'ErrorProvider1
'
Me.ErrorProvider1.ContainerControl = Me
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.Location = New System.Drawing.Point(3, 294)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(131, 14)
Me.Label8.TabIndex = 16
Me.Label8.Text = "Verificar por atualizações" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10)
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(575, 357)
Me.Controls.Add(Me.body)
Me.Controls.Add(Me.header)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "Form1"
Me.Text = "Form1"
Me.header.ResumeLayout(False)
CType(Me.PictureBox10, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox8, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit()
Me.body.ResumeLayout(False)
Me.body.PerformLayout()
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox9, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox6, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.ErrorProvider1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents header As System.Windows.Forms.Panel
Friend WithEvents body As System.Windows.Forms.Panel
Friend WithEvents bemvindo As System.Windows.Forms.Label
Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox5 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox6 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox7 As System.Windows.Forms.PictureBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents PictureBox9 As System.Windows.Forms.PictureBox
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents ErrorProvider1 As System.Windows.Forms.ErrorProvider
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox8 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox10 As System.Windows.Forms.PictureBox
Friend WithEvents Label8 As System.Windows.Forms.Label
End Class
I think by your (I forgot the name, that bar where you have the close and minimize) be different, ie a created by you do not have the property to move, that’s it ?
– Roberto Araujo
Enter details of how it is done. Give information that it is possible to evaluate what is happening.
– Maniero
Exactly Roberto, I removed it to be able to customize, and now I do not have this property.
– Maradinho PH
@bigown is basically the fact that I have customized the bar and now have no property
– Maradinho PH
I’ve seen a way to do it, but it’s been a long time and I remember it was complicated.
– Roberto Araujo
How do I answer here ? (found a code)
– Roberto Araujo
http://pastebin.com/SZcreAwe I haven’t had time to test, but I think it’ll work.
– Roberto Araujo
And put that code where? No header?
– Maradinho PH
Unfortunately it didn’t work.
– Maradinho PH
I used this code once and it worked 100%: http://stackoverflow.com/a/1592899/1274092. The only thing is that it is in C# and you will need to translate to VB. And it moves when you click on a form area; then you might want to use the evendo Mousedown of another component instead of using the form.
– Caffé
The thing is, I’m a beginner in VB.net. And I can’t translate that, but I appreciate your help.
– Maradinho PH
@I can translate for you if you reopen the question. You would have to show how you developed this fictitious title bar, perhaps by pasting the design code of the form (file "Nomeformulario.Designer.Vb"; otherwise I can do it in a way that doesn’t work for you and you won’t be able to adapt.
– Caffé
Done! Edited question.
– Maradinho PH
Now all that’s left is a good soul to reopen the question.
– Caffé
I’ll be waiting for you ^-^
– Maradinho PH