-
Oct 23rd, 2018, 04:25 AM
#1
Scaling up down on form controls
Hello.
I have a rich text box a gridview and an image control.
You can see on the picture how they are located (the picture box is the numbers next to the RTB).
What I want to do is scale the images up and down. Meaning that I can lift up and down the RTB and i will also expand or shrink the gridview and the opposite.
I have managed to do so on the left and right scaling, so expanding left right will also expand both RTB and gridview.
However up and down will either shrink to one corner or cover up one control over another.
I'm experiment with Anchor and dock but I can't make this work.
Any advice?Would you like me to post the designer code?
Thanks.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Oct 23rd, 2018, 07:05 AM
#2
Re: Scaling up down on form controls
Is this WPF or Windows Forms? You say that you have a GridView and an Image control, which sounds like WPF, but you also mention Anchor and Dock, which sounds like Windows Forms.
-
Oct 23rd, 2018, 07:32 AM
#3
Re: Scaling up down on form controls
Hi JMC.
Picture box - datagridview.
This is windows forms. Are we posting WPF here also?
Last edited by sapator; Oct 23rd, 2018 at 07:35 AM.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Oct 23rd, 2018, 07:56 AM
#4
Re: Scaling up down on form controls
Originally Posted by sapator
Are we posting WPF here also?
It wouldn't be the first time. Of course, if you use the correct names for things then there's less chance for confusion. I can't look at this right now but will soon, if no one else gets in in the mean time.
-
Oct 23rd, 2018, 08:01 AM
#5
Re: Scaling up down on form controls
You are correct but we usually understand what we are talking about (old timers).
There is no need to look this today as we are opening a new warehouse data main location and I don't have the time to look at this as I'm on and off from the servers constantly.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Oct 29th, 2018, 04:01 AM
#6
Re: Scaling up down on form controls
Hi.
So I'm showing the DATAgridview the RTB and the picturebox.
I' also posting the entire designer code. I'm not sure if I did an customization there but I think it was in another forms so 95% no
code:
Code:
<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.Button1 = New System.Windows.Forms.Button()
Me.DataGridView1 = New System.Windows.Forms.DataGridView()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.RichTextBox1 = New System.Windows.Forms.RichTextBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.txtboxfirsttext = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.txtboxlasttext = New System.Windows.Forms.TextBox()
Me.CheckBoxRemoveSpaces = New System.Windows.Forms.CheckBox()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.CheckBoxRemoveLines = New System.Windows.Forms.CheckBox()
Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
Me.RemoveCharacte*******tripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.RemoveReplaceCharacte*******tripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.UnicodeInputToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.UnicodeToolStripMenuItemCheck = New System.Windows.Forms.ToolStripMenuItem()
Me.AsciiTextToolStripMenuItemCheck = New System.Windows.Forms.ToolStripMenuItem()
Me.SearchToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ExitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.FormatToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.WordWrapToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.FontToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ButtonPrevious = New System.Windows.Forms.Button()
Me.ButtonNext = New System.Windows.Forms.Button()
Me.MyPictureBox = New System.Windows.Forms.PictureBox()
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.MenuStrip1.SuspendLayout()
CType(Me.MyPictureBox, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(39, 533)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(48, 23)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Go"
Me.Button1.UseVisualStyleBackColor = True
'
'DataGridView1
'
Me.DataGridView1.Location = New System.Drawing.Point(39, 269)
Me.DataGridView1.Name = "DataGridView1"
Me.DataGridView1.Size = New System.Drawing.Size(809, 258)
Me.DataGridView1.TabIndex = 2
'
'Label1
'
Me.Label1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(310, 540)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(0, 13)
Me.Label1.TabIndex = 4
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(310, 6)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(258, 13)
Me.Label2.TabIndex = 5
Me.Label2.Text = "Input - drag drop text below and click 'GO' for char ID"
'
'RichTextBox1
'
Me.RichTextBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.RichTextBox1.Location = New System.Drawing.Point(39, 27)
Me.RichTextBox1.Name = "RichTextBox1"
Me.RichTextBox1.Size = New System.Drawing.Size(811, 237)
Me.RichTextBox1.TabIndex = 6
Me.RichTextBox1.Text = ""
'
'Button2
'
Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button2.Location = New System.Drawing.Point(93, 533)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(84, 23)
Me.Button2.TabIndex = 7
Me.Button2.Text = "Validate Email"
Me.Button2.UseVisualStyleBackColor = True
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(559, 536)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(59, 23)
Me.Button3.TabIndex = 8
Me.Button3.Text = "Separate"
Me.Button3.UseVisualStyleBackColor = True
'
'txtboxfirsttext
'
Me.txtboxfirsttext.Location = New System.Drawing.Point(679, 538)
Me.txtboxfirsttext.MaxLength = 50
Me.txtboxfirsttext.Name = "txtboxfirsttext"
Me.txtboxfirsttext.Size = New System.Drawing.Size(35, 20)
Me.txtboxfirsttext.TabIndex = 9
Me.txtboxfirsttext.Text = "'"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(624, 541)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(49, 13)
Me.Label3.TabIndex = 10
Me.Label3.Text = "First text:"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(720, 541)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(50, 13)
Me.Label4.TabIndex = 11
Me.Label4.Text = "Last text:"
'
'txtboxlasttext
'
Me.txtboxlasttext.Location = New System.Drawing.Point(776, 537)
Me.txtboxlasttext.MaxLength = 50
Me.txtboxlasttext.Name = "txtboxlasttext"
Me.txtboxlasttext.Size = New System.Drawing.Size(35, 20)
Me.txtboxlasttext.TabIndex = 12
Me.txtboxlasttext.Text = "',"
'
'CheckBoxRemoveSpaces
'
Me.CheckBoxRemoveSpaces.AutoSize = True
Me.CheckBoxRemoveSpaces.Location = New System.Drawing.Point(448, 533)
Me.CheckBoxRemoveSpaces.Name = "CheckBoxRemoveSpaces"
Me.CheckBoxRemoveSpaces.Size = New System.Drawing.Size(105, 17)
Me.CheckBoxRemoveSpaces.TabIndex = 13
Me.CheckBoxRemoveSpaces.Text = "Remove Spaces"
Me.CheckBoxRemoveSpaces.UseVisualStyleBackColor = True
'
'ComboBox1
'
Me.ComboBox1.FormattingEnabled = True
Me.ComboBox1.Items.AddRange(New Object() {"ALL", "Only Valid", "Only Invalid"})
Me.ComboBox1.Location = New System.Drawing.Point(183, 535)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
Me.ComboBox1.TabIndex = 14
'
'CheckBoxRemoveLines
'
Me.CheckBoxRemoveLines.AutoSize = True
Me.CheckBoxRemoveLines.Location = New System.Drawing.Point(448, 550)
Me.CheckBoxRemoveLines.Name = "CheckBoxRemoveLines"
Me.CheckBoxRemoveLines.Size = New System.Drawing.Size(98, 17)
Me.CheckBoxRemoveLines.TabIndex = 15
Me.CheckBoxRemoveLines.Text = "Remove Empty"
Me.CheckBoxRemoveLines.UseVisualStyleBackColor = True
'
'MenuStrip1
'
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.RemoveCharacte*******tripMenuItem, Me.FormatToolStripMenuItem})
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name = "MenuStrip1"
Me.MenuStrip1.Size = New System.Drawing.Size(860, 24)
Me.MenuStrip1.TabIndex = 16
Me.MenuStrip1.Text = "MenuStrip1"
'
'RemoveCharacte*******tripMenuItem
'
Me.RemoveCharacte*******tripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.RemoveReplaceCharacte*******tripMenuItem, Me.UnicodeInputToolStripMenuItem, Me.SearchToolStripMenuItem, Me.ExitToolStripMenuItem})
Me.RemoveCharacte*******tripMenuItem.Image = Global.CharacterID.My.Resources.Resources.clicker_318_113944
Me.RemoveCharacte*******tripMenuItem.Margin = New System.Windows.Forms.Padding(32, -2, 32, -2)
Me.RemoveCharacte*******tripMenuItem.Name = "RemoveCharacte*******tripMenuItem"
Me.RemoveCharacte*******tripMenuItem.Padding = New System.Windows.Forms.Padding(1, 0, 1, 0)
Me.RemoveCharacte*******tripMenuItem.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.RemoveCharacte*******tripMenuItem.Size = New System.Drawing.Size(69, 24)
Me.RemoveCharacte*******tripMenuItem.Text = "Actions"
Me.RemoveCharacte*******tripMenuItem.TextAlign = System.Drawing.ContentAlignment.BottomCenter
'
'RemoveReplaceCharacte*******tripMenuItem
'
Me.RemoveReplaceCharacte*******tripMenuItem.Image = Global.CharacterID.My.Resources.Resources.icons8_edit_50
Me.RemoveReplaceCharacte*******tripMenuItem.Name = "RemoveReplaceCharacte*******tripMenuItem"
Me.RemoveReplaceCharacte*******tripMenuItem.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.RemoveReplaceCharacte*******tripMenuItem.Size = New System.Drawing.Size(222, 22)
Me.RemoveReplaceCharacte*******tripMenuItem.Text = "Remove/Replace Characters"
Me.RemoveReplaceCharacte*******tripMenuItem.TextAlign = System.Drawing.ContentAlignment.BottomCenter
Me.RemoveReplaceCharacte*******tripMenuItem.TextDirection = System.Windows.Forms.ToolStripTextDirection.Horizontal
Me.RemoveReplaceCharacte*******tripMenuItem.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage
'
'UnicodeInputToolStripMenuItem
'
Me.UnicodeInputToolStripMenuItem.Checked = True
Me.UnicodeInputToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked
Me.UnicodeInputToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.UnicodeToolStripMenuItemCheck, Me.AsciiTextToolStripMenuItemCheck})
Me.UnicodeInputToolStripMenuItem.Name = "UnicodeInputToolStripMenuItem"
Me.UnicodeInputToolStripMenuItem.Size = New System.Drawing.Size(222, 22)
Me.UnicodeInputToolStripMenuItem.Text = "Check, to use manual text"
'
'UnicodeToolStripMenuItemCheck
'
Me.UnicodeToolStripMenuItemCheck.Checked = True
Me.UnicodeToolStripMenuItemCheck.CheckState = System.Windows.Forms.CheckState.Checked
Me.UnicodeToolStripMenuItemCheck.Name = "UnicodeToolStripMenuItemCheck"
Me.UnicodeToolStripMenuItemCheck.Size = New System.Drawing.Size(140, 22)
Me.UnicodeToolStripMenuItemCheck.Text = "Unicode text"
'
'AsciiTextToolStripMenuItemCheck
'
Me.AsciiTextToolStripMenuItemCheck.Checked = True
Me.AsciiTextToolStripMenuItemCheck.CheckState = System.Windows.Forms.CheckState.Checked
Me.AsciiTextToolStripMenuItemCheck.Name = "AsciiTextToolStripMenuItemCheck"
Me.AsciiTextToolStripMenuItemCheck.Size = New System.Drawing.Size(140, 22)
Me.AsciiTextToolStripMenuItemCheck.Text = "Ascii text"
'
'SearchToolStripMenuItem
'
Me.SearchToolStripMenuItem.Image = Global.CharacterID.My.Resources.Resources._71646d7673e8847ab07b3b7e78928777_search_circle_icon_by_vexels
Me.SearchToolStripMenuItem.Name = "SearchToolStripMenuItem"
Me.SearchToolStripMenuItem.Size = New System.Drawing.Size(222, 22)
Me.SearchToolStripMenuItem.Text = "Search"
'
'ExitToolStripMenuItem
'
Me.ExitToolStripMenuItem.Image = Global.CharacterID.My.Resources.Resources.if_exit_6035
Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(222, 22)
Me.ExitToolStripMenuItem.Text = "Exit"
'
'FormatToolStripMenuItem
'
Me.FormatToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.WordWrapToolStripMenuItem, Me.FontToolStripMenuItem})
Me.FormatToolStripMenuItem.Image = Global.CharacterID.My.Resources.Resources.format
Me.FormatToolStripMenuItem.Name = "FormatToolStripMenuItem"
Me.FormatToolStripMenuItem.Size = New System.Drawing.Size(73, 20)
Me.FormatToolStripMenuItem.Text = "Format"
'
'WordWrapToolStripMenuItem
'
Me.WordWrapToolStripMenuItem.Name = "WordWrapToolStripMenuItem"
Me.WordWrapToolStripMenuItem.Size = New System.Drawing.Size(328, 22)
Me.WordWrapToolStripMenuItem.Text = "Word Wrap (uncheck, might error with unicode)"
'
'FontToolStripMenuItem
'
Me.FontToolStripMenuItem.Image = Global.CharacterID.My.Resources.Resources.font_colors
Me.FontToolStripMenuItem.Name = "FontToolStripMenuItem"
Me.FontToolStripMenuItem.Size = New System.Drawing.Size(328, 22)
Me.FontToolStripMenuItem.Text = "Font"
'
'ButtonPrevious
'
Me.ButtonPrevious.ForeColor = System.Drawing.Color.Crimson
Me.ButtonPrevious.Location = New System.Drawing.Point(313, 535)
Me.ButtonPrevious.Name = "ButtonPrevious"
Me.ButtonPrevious.Size = New System.Drawing.Size(62, 23)
Me.ButtonPrevious.TabIndex = 18
Me.ButtonPrevious.Text = "Previous"
Me.ButtonPrevious.UseVisualStyleBackColor = True
Me.ButtonPrevious.Visible = False
'
'ButtonNext
'
Me.ButtonNext.ForeColor = System.Drawing.Color.Crimson
Me.ButtonNext.Location = New System.Drawing.Point(380, 535)
Me.ButtonNext.Name = "ButtonNext"
Me.ButtonNext.Size = New System.Drawing.Size(62, 23)
Me.ButtonNext.TabIndex = 19
Me.ButtonNext.Text = "Next"
Me.ButtonNext.UseVisualStyleBackColor = True
Me.ButtonNext.Visible = False
'
'MyPictureBox
'
Me.MyPictureBox.Location = New System.Drawing.Point(0, 27)
Me.MyPictureBox.Name = "MyPictureBox"
Me.MyPictureBox.Size = New System.Drawing.Size(38, 237)
Me.MyPictureBox.TabIndex = 17
Me.MyPictureBox.TabStop = False
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(860, 568)
Me.Controls.Add(Me.ButtonNext)
Me.Controls.Add(Me.ButtonPrevious)
Me.Controls.Add(Me.MyPictureBox)
Me.Controls.Add(Me.CheckBoxRemoveLines)
Me.Controls.Add(Me.ComboBox1)
Me.Controls.Add(Me.CheckBoxRemoveSpaces)
Me.Controls.Add(Me.txtboxlasttext)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.txtboxfirsttext)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.RichTextBox1)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.DataGridView1)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.MenuStrip1)
Me.MainMenuStrip = Me.MenuStrip1
Me.MaximumSize = New System.Drawing.Size(1200, 606)
Me.MinimumSize = New System.Drawing.Size(640, 606)
Me.Name = "Form1"
Me.Text = "Daytools"
CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
Me.MenuStrip1.ResumeLayout(False)
Me.MenuStrip1.PerformLayout()
CType(Me.MyPictureBox, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents RichTextBox1 As System.Windows.Forms.RichTextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents txtboxfirsttext As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents txtboxlasttext As System.Windows.Forms.TextBox
Friend WithEvents CheckBoxRemoveSpaces As System.Windows.Forms.CheckBox
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents CheckBoxRemoveLines As System.Windows.Forms.CheckBox
Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
Friend WithEvents RemoveCharacte*******tripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents MyPictureBox As System.Windows.Forms.PictureBox
Friend WithEvents RemoveReplaceCharacte*******tripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents UnicodeInputToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents UnicodeToolStripMenuItemCheck As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents AsciiTextToolStripMenuItemCheck As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SearchToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ButtonPrevious As System.Windows.Forms.Button
Friend WithEvents ButtonNext As System.Windows.Forms.Button
Friend WithEvents FormatToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents WordWrapToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents FontToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ExitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
End Class
Edit: Forum found inappropriate code and edited it with "*" . I'm DIRTY programmer! Lol
Last edited by sapator; Oct 29th, 2018 at 04:44 AM.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
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
|