here's a dll that handles vb IDE style runtime move + resize for your controls
edit: this is written in vb2010. for vb2005 + vb2008 versions see post #4
here's a dll that handles vb IDE style runtime move + resize for your controls
edit: this is written in vb2010. for vb2005 + vb2008 versions see post #4
Last edited by .paul.; Jan 28th, 2010 at 11:20 AM.
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
are you using vb2010???
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
ok. i converted it for vb2005 + vb2008
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Hi .paul., im having a problem, could you help, im using the visual studio 2008 version, i can import the class etc into a new blank project and it all works great, how ever everytime i try to import it into my current project i get this error:
Steps i take to import it:
1, Import the .jpg resource
2, Reference the MoveResizeControl
3, Add controlHandler.vb tot he solution
4, add in the code from form1.
Thanks.
try comparing the references + imports in the project where it works + the project where it doesn't
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Hey, ok seems in a pre made project all the references were not been auto imported, so ive done them and it now builds with no error, but it messes the BG up, take a look (BG is normally black)
![]()
are you using a backgroundimage?
if yes, try using the backcolor instead
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Hey, no im only using BG color, no image, on the form i have a combo box which changes bg color themes and out of the 6 other color themes, but there not triggered, so they shouldn't be affecting this, right? (O_o).
When it loads with the red X its partially functional, the 2 picture boxes can be clicked dona nd moved/resized, the movement when moving them tho feels very sluggish and choppy compared tot he demo project or when there added to a new project.
can you post the code from that form?
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Theres bucket loads of code on the page, theres 2 main parts which may be conflictign with your code so ill paste those, this one,
Users can select a BG color/theme:
That part, on page load the form is set to just be on default settings which is the BG color of the page set to black, i had thought this code would conflict, but as none of the themes are selected just the default one i thought it'd be ok.Code:Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged If (ComboBox2.SelectedItem = "Custom") Then OpenFileDialog2.ShowDialog() Dim sBackgroundImage As String sBackgroundImage = OpenFileDialog2.FileName Me.BackgroundImage = New System.Drawing.Bitmap(sBackgroundImage) Me.BackgroundImageLayout = ImageLayout.Stretch 'OR: Me.BackgroundImage = New System.Drawing.Bitmap(OpenFileDialog2.FileName) Me.BackgroundImageLayout = ImageLayout.Stretch ElseIf (ComboBox2.SelectedItem = "Midnight v2") Then Me.BackColor = Color.Black Me.BackgroundImage = Nothing ''folders ListBox1.BackColor = Color.Black ListBox1.ForeColor = Color.Gray ListBox1.BorderStyle = BorderStyle.None ''files ListBox2.BackColor = Color.Black ListBox2.ForeColor = Color.Gray ListBox2.BorderStyle = BorderStyle.None ''serial: serial.BackColor = Color.Black serial.ForeColor = Color.Gray serial.BorderStyle = BorderStyle.None ''name: namefull.BackColor = Color.Black namefull.ForeColor = Color.Gray namefull.BorderStyle = BorderStyle.None ''version: version.BackColor = Color.Black version.ForeColor = Color.Gray version.BorderStyle = BorderStyle.None ''genre: genre.BackColor = Color.Black genre.ForeColor = Color.Gray genre.BorderStyle = BorderStyle.None ''Date: date1.BackColor = Color.Black date1.ForeColor = Color.Gray date1.BorderStyle = BorderStyle.None ElseIf (ComboBox2.SelectedItem = "Midnight") Then Me.BackgroundImage = New System.Drawing.Bitmap(Application.StartupPath() & "\BG\" & "themmoon.jpg") ''folders ListBox1.BackColor = Color.Black ListBox1.ForeColor = Color.Gray ListBox1.BorderStyle = BorderStyle.Fixed3D ''files ListBox2.BackColor = Color.Black ListBox2.ForeColor = Color.Gray ListBox2.BorderStyle = BorderStyle.Fixed3D ''serial: serial.BackColor = Color.Black serial.ForeColor = Color.Gray serial.BorderStyle = BorderStyle.Fixed3D ''name: namefull.BackColor = Color.Black namefull.ForeColor = Color.Gray namefull.BorderStyle = BorderStyle.Fixed3D ''version: version.BackColor = Color.Black version.ForeColor = Color.Gray version.BorderStyle = BorderStyle.Fixed3D ''genre: genre.BackColor = Color.Black genre.ForeColor = Color.Gray genre.BorderStyle = BorderStyle.Fixed3D ''Date: date1.BackColor = Color.Black date1.ForeColor = Color.Gray date1.BorderStyle = BorderStyle.Fixed3D end if
Theres also a similar combobox used to change between some preset layouts, heres that code:
There the only bits of code which affect the forms look or layout in my project.Code:Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If (ComboBox1.SelectedItem = "Standard") Then ''folders ListBox1.Location = New Point(8, 72) ListBox1.Size = New Size(419, 394) ''files ListBox2.Location = New Point(8, 484) ListBox2.Size = New Size(419, 225) ''serial: serial.Location = New Point(451, 501) ''name: namefull.Location = New Point(451, 469) namefull.Size = New Size(534, 26) ''region: flagu.Location = New Point(451, 533) flagj.Location = New Point(451, 533) flage.Location = New Point(451, 533) ''version: version.Location = New Point(940, 501) ''genre: genre.Location = New Point(637, 501) ''Date: date1.Location = New Point(808, 501) ''front: pboxGameCover.Size = New Size(261, 370) pboxGameCover.Location = New Point(455, 82) ''back: pboxGameCoverA.Show() pboxGameCoverA.Size = New Size(261, 370) pboxGameCoverA.Location = New Point(722, 82) ElseIf (ComboBox1.SelectedItem = "Large Front") Then ''folders ListBox1.Location = New Point(8, 72) ListBox1.Size = New Size(419, 290) ''files ListBox2.Location = New Point(8, 368) ListBox2.Size = New Size(419, 147) ''serial: serial.Location = New Point(8, 553) ''name: namefull.Location = New Point(8, 521) namefull.Size = New Size(419, 26) ''region: flagu.Location = New Point(315, 585) flagj.Location = New Point(315, 585) flage.Location = New Point(315, 585) ''version: version.Location = New Point(365, 553) ''genre: genre.Location = New Point(194, 553) ''Date: date1.Location = New Point(8, 585) ''front: pboxGameCover.Size = New Size(452, 627) pboxGameCover.Location = New Point(482, 82) ''back: pboxGameCoverA.Hide() ElseIf (ComboBox1.SelectedItem = "Minimal") Then ''folders ListBox1.Location = New Point(8, 72) ListBox1.Size = New Size(284, 394) ''files ListBox2.Location = New Point(8, 484) ListBox2.Size = New Size(284, 134) ''serial: serial.Location = New Point(451, 114) ''name: namefull.Location = New Point(451, 82) namefull.Size = New Size(534, 26) ''region: flagu.Location = New Point(350, 82) flagj.Location = New Point(350, 82) flage.Location = New Point(350, 82) ''version: version.Location = New Point(940, 114) ''genre: genre.Location = New Point(637, 114) ''Date: date1.Location = New Point(808, 114) ''front: pboxGameCover.Size = New Size(261, 370) pboxGameCover.Location = New Point(300, 157) ''back: pboxGameCoverA.Hide() End If
try commenting out ComboBox2_SelectedIndexChanged. i suspect it's the backgoundimages
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
OK i removed the all code to do with themes, tested, same issue, so then i removed all code to do with layouts, tested again same issue.
One thing i have noticed tho, whilst testing and the red X is there etc, the pictureboxs as i said are very sluggish feeling when moving them and as there moved the re X int he BG flickers, how ever if i try to move a listbox it moves perfectly, nice smooth and fast and no flicker, so the issue seems to be around the picture boxes, my pic boxes have no code related to them currently tho,.
the red x is there because an error occurred drawing the background in the paint event
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Just done a test to check other code, i removed all code from my project except the code for this, and the error is still there, so then i one by one deleted all controls on the form so the form is now blank except 1 pic box and a list box for testing, no code except whats there for this, and the error is still present.
are you using 3.5 framework in your project?
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
yeah, it wasn't at first tho, but i set it to use 3.5 inthe advanced compile options, before importing any of this controls code.
i can't see where the problem is. try adding your components + code bit by bit to a project where move / resize is working + checking it's still working at each stage.
if you can isolate the problem that way, hopefully i can help more then...
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Hey, sorry for the late reply, my current project is a little to far gone to rebuild but i have another part of the same project to build which ill try this in along with the same components i used in my current project and report back if one of them is causing the issue.
Hello paul
I am trying to use your move resize label in my project at run time but I got one small problem.
After I call add a label using this code:
The label doesn't function as good as the ones you have on your project already sitting on the form. I am able to move it but not resize it, I think it draws the square but it fails at drawing the dots. I am not very familiar with drawings in coding but if you know what should I change in code of the moveresizelabel.vb I would appreciate.Code:Dim label() As MoveResizeLabel Dim nlabel As Integer Private Sub LabelToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LabelToolStripMenuItem.Click ReDim Preserve label(nlabel) label(nlabel) = New MoveResizeLabel Me.Controls.Add(label(nlabel)) label(nlabel).Location = New Point(100, 100) label(nlabel).Text = "Label" End Sub
Thank you
that's not my code you're using.
i think that's NickThissen's MoveResizeLabel you're referring to
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
I am using the code you have posted here, the 2008 version. I am using your move resize label for my application.
This little bit is my code (I am putting one of those labels on my form at run time)
I think the problem might be somewhere in these subs:Code:Dim label() As MoveResizeLabel Dim nlabel As Integer Private Sub LabelToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LabelToolStripMenuItem.Click ReDim Preserve label(nlabel) label(nlabel) = New MoveResizeLabel Me.Controls.Add(label(nlabel)) label(nlabel).Location = New Point(100, 100) label(nlabel).Text = "Label" End Sub
Code:Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) 'MsgBox = 513 MyBase.WndProc(m) Dim g As Graphics = Me.CreateGraphics 'on paint with customcolor borderstyle If m.Msg = 15 And Me.BorderStyle = CustomBorderStyles.None Then g.DrawRectangle(New Pen(bdrColor, 1), New Rectangle(0, 0, Me.Width - 1, Me.Height - 1)) End If 'on paint if selected If m.Msg = 15 And Me.Selected = True Then DrawDashedRectangle() DrawSquareResizeHandles() End If g.Dispose() End Sub Private Sub DrawSquareResizeHandles() Dim g As Graphics = Me.CreateGraphics g.FillRectangle(Brushes.Black, rTopLeft) g.FillRectangle(Brushes.Black, rTopRight) g.FillRectangle(Brushes.Black, rBotRight) g.FillRectangle(Brushes.Black, rBotLeft) g.FillRectangle(Brushes.Black, rTopMid) g.FillRectangle(Brushes.Black, rBotMid) g.FillRectangle(Brushes.Black, rMidLeft) g.FillRectangle(Brushes.Black, rMidRight) End Sub Private Sub DrawDashedRectangle() Dim g As Graphics = Me.CreateGraphics Dim points() As Point = GetPointsForSelectedLines() Dim count As Integer g.DrawRectangle(Pens.White, New Rectangle(0, 0, Me.Width - 1, Me.Height - 1)) For count = 0 To points.Length - 1 Step 2 If count + 1 = points.Length Then Exit Sub End If g.DrawLine(Pens.Black, points(count), points(count + 1)) Next End Sub
Last edited by MrtforCode; Jun 8th, 2010 at 10:51 AM.
oh I am sorry, the bit with the move resize label was not your code. But I still want to ask you a question about the code you have done.
You actually made mostly any control (textbox, groupbox, richtextbox, listbox...) movable and sizable except the label, or could it easily move resize a label as well? Where do I need to improve to get it working on a label as well?
Last edited by MrtforCode; Jun 8th, 2010 at 10:59 AM.
there seems to be a problem using my code with the label control + i'm not 100% sure but i think the API functions don't work with the label control
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
I saw the strange label behavior as well, it does not seem to work. If all you need is a simple line of text (no auto-ellipsis, auto-size, stuff like that) then you can use a PictureBox instead and draw the text manually using Graphics.DrawString.
Controls:
*NEW* OptionsView control with rich design-time support - MonthPicker - Validators for Winforms - Double TrackBar - Editable ListBox - Outlook Navigation Bar - ColorListBox with images - Advanced ToolStripContainer - RadioButtonGroup Control - Expandable Groupbox - Wizard Template Usercontrol (full Design-time support!) ... Now with Aero Glass support! - 3D Separator - ListView Options Screen - TabControl with tab-specific ContextMenuStrips and Tab-Dragging
Menustrip and Toolstrip Renderers:
Visual Studio 2010 - Customizable Menu/ToolStrip (incl Office 2007 + all Office 2003 styles) - Office 2007 - Visual Studio 2008 - [WIP]Vista Toolstrip
Misc:
*NEW* Thread safe property setting extension - Cup(Of T) - Snapping windows - *UPDATED* Advanced Shape Editor like Visual Studio - ByVal vs ByRef and value types vs reference types - Game Of Life - OOP Tic Tac Toe game example - Moving and Resizing a Control or a Borderless Form, using SendMessage (smooth) - Manual 'MDI Window List' menu - Tabbed MDI Text Editor - Very Extensive MDI text editor - Real Synchronized RichTextBox scrolling - Notepad-like New/Open/Save/SaveAs/Exit behaviour
Well, I will try to adjust the code to work for me but first I will need to study it out.
One question .paul., what makes the mouse cursor turn into 'move' cursor on mouseover the 'move' tag, can you show me the sub that does that? I could not find it, I want to apply something like this to NickThissen's label![]()
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Wow this is truly amazing! Good job on this , I will be using this in the future thanks so much. Your the best
Great job on this, thanks Paul!
A couple of questions...
I would like to add an "edit" mode and "normal" mode so that the resize/move handles only show when in edit mode. How would you suggest going about that?
I would like to be able to save the controls' new sizes and layout. Does vb have an easy "save all" method to save all the page's control location and sizes?
1/ add a property, canSelect:
vb Code:
Private _canSelect As Boolean = True Public Property canSelect As Boolean Get Return _canSelect End Get Set(ByVal value As Boolean) _canSelect = value End Set End Property
then, in mControl_mousedown:
vb Code:
Private Sub mControl_mousedown(ByVal sender As Object, ByVal e As System.EventArgs) If Not canSelect Then Return
to toggle selectability, change the property.
2/ yes. (ApplicationSettings)
here's an example. it saves (+ loads) the text property, but you'll use the location + size properties:
http://www.vbforums.com/showpost.php...48&postcount=2
unfortunately that doesn't work for dynamically added controls. you'll need to work something out using my.settings if your controls were added at runtime...
![]()
![]()
if this helps, rate me
![]()
![]()
irregular regions | numericTextbox | keycodes | removing control properties | hotkeys | rtf printing | Extended RichTextBox | iconWorks | readonly listbox | sort listview | screen capture | relational listForms | countDown timer | animated notifyIcon form | dynamic crystal report | move / resize runtime controls | reOrderable DnD listview / listbox | self closing message box | searchable list(of class) | cursor from bitmap | (VB2008+) Textbox - GetFirstVisibleLineIndex / GetLastVisibleLineIndex | vb2008 extensions | Paint lite.Net | calculator | inline calculator | export listview to word table | imperial~metric converter | export DGV to word ~ excel | globalInputHook | dropDown Calendar control | International Time + Currency | GDI+ gauge | quizControl | extended dgv
My Web Site....
Maths Revision V1.0
Play Connect4 against your PC (java Applet)
Thanks very much!
Hi Paul,
This class is very impressive and so simple to use, just a FYI to anybody having trouble getting this to work with labels (I know I did!) just set the AutoSizeMode to None and it works fine. The API won't work with controls that have any kind of autosizing and this includes anchor.
I have a database program that allows the user to design their own data entry screens, with an IDE very simular to VS but after a while I ran into problems with labels not moving & anchor properties on any control.
If you need to use anchors (i.e Top, Left works fine, but Top, Left, Right will not) just store the control anchors in a variable when it is selected (i.e in mControl_mousedown), then set the control anchor to Top,Left and then restore the original anchor properties in move_mousemove within the If GetCapture=0 statement.
Many Thanks paul