Results 1 to 31 of 31

Thread: [RESOLVED] Drawing gray rectangle instead of actually resizing

  1. #1

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Resolved [RESOLVED] Drawing gray rectangle instead of actually resizing

    Is there a way to create the effect that I have seen many programs do invloving a gray rectangle? When you drag the corner/side of something to resize it, you see a gray outline of where it WOULD be resized to if you left go of the mouse button.

    The reason I ask is because I have an MDI form with a control aligned to one side that I want to make resizable. I added a very narrow picture box aligned to the same side the creates the effect of a re-size bar. The problem is the form flickers a lot when I resize it. I was wondering if there was a way to draw this rectangle ontop of all other windows to show where the control would be resized to if you left go of the mouse button. Any ideas?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Drawing gray rectangle instead of actually resizing

    See if this sample works for you - it draws a rectangle when mouse is down on the form:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Type tRect
    4.     sLeft As Single
    5.     sTop As Single
    6.     sRight As Single
    7.     sBottom As Single
    8. End Type
    9. Private tRect As tRect
    10.  
    11. Private bDragging As Boolean
    12.  
    13. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    14.     bDragging = True
    15.     Me.Cls
    16.     Me.DrawMode = vbInvert
    17.     With tRect
    18.         .sLeft = X
    19.         .sTop = Y
    20.         .sRight = X
    21.         .sBottom = Y
    22.     End With
    23. End Sub
    24.  
    25. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    26.     If Not bDragging Then Exit Sub
    27.     With tRect
    28.         Me.Line (.sLeft, .sTop)-(.sRight, .sBottom), , B
    29.         .sRight = X
    30.         .sBottom = Y
    31.         Me.Line (.sLeft, .sTop)-(X, Y), , B
    32.     End With
    33. End Sub
    34.  
    35. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    36.     bDragging = False
    37.     Me.Line (tRect.sLeft, tRect.sTop)-(tRect.sRight, tRect.sBottom), , B
    38.     Me.DrawMode = vbCopyPen
    39.     Me.Cls
    40. End Sub

  3. #3

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    That won't work quite right because I the control is aligned on an MDI form. I need the rectangle to be able to be ontop of any MDI windows (which would mean it can't be drawn ontop of the form). Here is a screen shot...
    Attached Images Attached Images  
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  4. #4

  5. #5

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing



    My bad. I had a feeling that would happen.

    "Right-aligned contorl on MDI parent": It is an MDI form that I am deeling with. For MDI forms you can only put controls directly on the form that are alignable. We are clear on this point, right?

    "Resize bar": Okay, I wanted to give the IMPRESSION that that control was resizable, so I added a narrow picture box (30 twips wide) that gives you the W E arrow pointer that makes you think you can resize something if you click and drag.

    "MDI Child window": The white area to the left is a maximized MDI child window.

    Now, if I use the code you posted, it wouldn't work, because I need the rectangle to be ontop of ALL OF THAT so that you know where you are resizing to without acutally doing the resize before hand.

    I am probably asking too much, but I thought it might not be too hard. Here is another screenshot of the desired effect.
    Attached Images Attached Images  
    Last edited by eyeRmonkey; Oct 12th, 2005 at 12:35 AM.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Drawing gray rectangle instead of actually resizing

    Oh, so you need to mimic MDI splitter. Now we talking...
    Here is nice little sample created by Edward Blake from www.cyanwerks.com (see attachments).

    And here is another one (not mdi though but also nice): Form Splitter .
    Attached Files Attached Files

  7. #7

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    Thanks RB. That is really close to what I am looking for, but not quite. I am guessing it isn't really possible to draw a line ontop of all the windows, otherwise the attachemnt project you posted would have done it that way. I might use that though. Great example. Thanks!
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  8. #8

  9. #9
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    Quote Originally Posted by eyeRmonkey
    I am guessing it isn't really possible to draw a line ontop of all the windows, otherwise the attachemnt project you posted would have done it that way.
    Oh, it's fully possible to draw lines above all other windows by getting a device context of the desktop. I do that in my Windows Finder Tool (available in the CodeBank). But before you go and look at that I quickly wrote a little class module for you that you might find helpful. It's not 100% perfect since it will draw the line even when you drag it outside of the MDI window but you should be able to adjust that with a little more code.

    This is how you use the class:
    VB Code:
    1. Private WithEvents oSplitter As CSplitter
    2.  
    3. Private Sub MDIForm_Load()
    4.     Set oSplitter = New CSplitter
    5.     Call oSplitter.Init(picSplitter)
    6. End Sub
    7.  
    8. Private Sub MDIForm_Unload(Cancel As Integer)
    9.     oSplitter.Destroy
    10.     Set oSplitter = Nothing
    11. End Sub
    12.  
    13. Private Sub oSplitter_Dropped(ByVal AdjustLeft As Long)
    14.     Debug.Print AdjustLeft
    15. End Sub
    As you can see you must call the Init method and pass the PictureBox you use as the splitter as an argument. The class will then handle everything when you start dragging the picture box and it will raise the Dropped event when you stop dragging. The Dropped event has one argument called AdjustLeft which is how many pixels (you might need to recalculate that to Twips) away from the origional position you made the drop. This could be a negative value if you drag to the left.

    Before you close the Form you should call the Destroy method to be 100% safe.

    Edit: Here's a screen shot of how it could look:
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by Joacim Andersson; Oct 12th, 2005 at 01:09 PM.

  10. #10
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Drawing gray rectangle instead of actually resizing

    One idea I had is that you can add a usercontrol to your project. Set the background to transparent and use it as a sizing box. Here is an example of sizing a picturebox
    put a picturebox and usercontrol on your form. Name the usercontrol dragbox and bring it to the front
    VB Code:
    1. Option Explicit
    2. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    3.  
    4. Private isCaptured As Boolean
    5.  
    6. Private xBorderWidth As Long
    7. Private yBorderWidth As Long
    8. Private OnTheBorder As Boolean
    9.  
    10. Private myX As Long
    11. Private myY As Long
    12. Private myWidth As Long
    13. Private myHeight As Long
    14. Private myLeft As Long
    15. Private myTop As Long
    16.  
    17.  
    18. Private onLeft As Boolean
    19. Private onRight As Boolean
    20. Private onTop As Boolean
    21. Private onBottom As Boolean
    22.  
    23. Private Sub Form_Load()
    24.     DragBox.Visible = False
    25.     'get borderwidths
    26.     xBorderWidth = (Picture1.Width - Picture1.ScaleWidth)
    27.     yBorderWidth = (Picture1.Height - Picture1.ScaleHeight)
    28. End Sub
    29.  
    30. Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    31.     If Button = 1 And OnTheBorder Then
    32.         isCaptured = True
    33.         With Picture1
    34.             SetCapture .hwnd
    35.             Debug.Print "Captured"
    36.             DragBox.Move .Left, .Top, .Width, .Height
    37.             .Visible = False
    38.             myWidth = .Width
    39.             myHeight = .Height
    40.             myLeft = .Left
    41.             myTop = .Top
    42.         End With
    43.         DragBox.Visible = True
    44.         myX = x
    45.         myY = y
    46.     End If
    47.    
    48. End Sub
    49.  
    50. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    51.   If isCaptured Then
    52.     If onTop Then
    53.         DragBox.Top = myTop + y - myY
    54.         DragBox.Height = myHeight - (y - myY)
    55.     End If
    56.    
    57.     If onBottom Then DragBox.Height = myHeight + y - myY
    58.    
    59.     If onLeft Then
    60.         DragBox.Left = myLeft + (x - myX)
    61.         DragBox.Width = myWidth - (x - myX)
    62.     End If
    63.    
    64.     If onRight Then DragBox.Width = myWidth + x - myX
    65.    
    66.   Else
    67.     onTop = False
    68.     onBottom = False
    69.     onLeft = False
    70.     onRight = False
    71.     OnTheBorder = True
    72.     'find out where mouse pointer is
    73.     If x <= xBorderWidth Then onLeft = True
    74.     If y <= yBorderWidth Then onTop = True
    75.     If Picture1.Height - y <= 3 * yBorderWidth Then onBottom = True
    76.     If Picture1.Width - x <= 3 * xBorderWidth Then onRight = True
    77.    
    78.     If onLeft And onTop Then
    79.         Picture1.MousePointer = vbSizeNWSE
    80.     ElseIf onLeft And onBottom Then
    81.         Picture1.MousePointer = vbSizeNESW
    82.     ElseIf onRight And onTop Then
    83.         Picture1.MousePointer = vbSizeNESW
    84.     ElseIf onRight And onBottom Then
    85.         Picture1.MousePointer = vbSizeNWSE
    86.     ElseIf onTop Then
    87.         Picture1.MousePointer = vbSizeNS
    88.     ElseIf onBottom Then
    89.         Picture1.MousePointer = vbSizeNS
    90.     ElseIf onLeft Then
    91.         Picture1.MousePointer = vbSizeWE
    92.     ElseIf onRight Then
    93.         Picture1.MousePointer = vbSizeWE
    94.     Else
    95.         Picture1.MousePointer = vbDefault
    96.         OnTheBorder = False
    97.     End If
    98.  End If
    99. End Sub
    100.  
    101. Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    102.     If isCaptured Then
    103.         With DragBox
    104.             Picture1.Move .Left, .Top, .Width, .Height
    105.             .Visible = False
    106.         End With
    107.         Picture1.Visible = True
    108.         isCaptured = False
    109.         OnTheBorder = False
    110.     End If
    111.    
    112. End Sub

  11. #11
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    OK. I've added a Boundaries method which sets how long you can drag the splitter. I also added a StartDragging event in which you can Cancel the dragging if you like, but this is also a good place to set the boundaries.
    VB Code:
    1. Private Sub oSplitter_StartDragging(Cancel As Boolean)
    2.     'You could set the Cancel argument to True if you do not
    3.     'want to allow the resizing.
    4.     Call oSplitter.SetBoundaries(MDIForm1.hWnd, 50)
    5. End Sub
    The above will set the boundaries to an offset of 50 pixels from the left and right borders of the MDIForm (a pretty good value, but try it out).

    I've updated my previous post with the updated class module.

  12. #12
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    @Moeur: But will that draw the drag rectangle above child windows as in this screen shot?
    Attached Images Attached Images  

  13. #13
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Drawing gray rectangle instead of actually resizing

    maybe I don't understand what the monkey is looking for. I was trying to build something like the picture in post #5. I'm not too familiar with MDI forms, so maybe you are saying that there is no way I can put the control on the MIDI form properly?
    Last edited by moeur; Oct 12th, 2005 at 11:08 AM.

  14. #14
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Drawing gray rectangle instead of actually resizing

    Ah yes...
    It appears that you cannot place a usercontrol onto a MDI form.

  15. #15
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    I made another slight change to my class module for the line to look a bit better.
    Attached Images Attached Images  
    Last edited by Joacim Andersson; Oct 12th, 2005 at 11:41 AM.

  16. #16
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Drawing gray rectangle instead of actually resizing

    That's nice Joacim (it really is ) but somewhat close to that project I've posted but I think eye wants to draw (or mimic if you will) entire rectangle and not single "vertical line" so I'm thinking that multiple pic boxes will do it but it also might create some overhead. What do you think?

  17. #17
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    I never looked at the project you posted. However drawing a full rectangle is not a problem you just have to draw the other 3 lines. The class of course needs to know where the "anchor" is, the upper left corner or the upper right corner of the rectangle depending on if your window is attached to the left or right hand side of the MDI Form.

  18. #18
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    OK, let's call this the final update... See the attached demo project on how to use the class (I've also added a Color property so you can change the color of the dragging rectangle). The rectangle is optional, and you can still use it with just a line as previous posts show.
    Attached Images Attached Images  
    Attached Files Attached Files

  19. #19

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    WOW! JA, thats awesome! Thanks a ton. I am not at home right now but I wll definitely take a look at that. You should post that in the code bank. Maybe we can work together to have it offer all the proper options (like offering an option for just vertical OR anchored) and then you can post it in the code bank. I bet it would get a lot of downloads.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  20. #20
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    As I said, the "anchored" version is optional. If you don't supply an anchor window only the vertical line will be drawn.

  21. #21

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    I hate being a perfectionist, but if this wouldn't be too much work it would be awesome if you could get the line to look like this (a pattern instead of a solid color):
    Attached Images Attached Images  
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  22. #22
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    Oh dear... There is just no way of pleasing some people

    OK, attached is another version of the class (and a demo project). The demo now shows everything the class can do and you can change the styles of the class using the menu items. You can now either use a (changeble) color or you can use the pattern style, this code now shows how to draw a dotted line (or a line of any pattern).

    Even though the demo is entitled MDISplitter, the class can just as well be used with regular Forms. However as it is designed (now) it is only a vertical splitter not a horizontal.

    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by Joacim Andersson; Oct 12th, 2005 at 08:58 PM.

  23. #23
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Drawing gray rectangle instead of actually resizing

    Nice work Joacim

    (still can't rate you at this time)

  24. #24
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Drawing gray rectangle instead of actually resizing

    Got you covered

  25. #25

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    Beautiful wonderful awesome work JA!

    I'm working on adding the following:
    * Horizontal support
    * A focus on a more specific situation (MDI windows and aligned controls on them) instead of a general spliter
    * More ease of use and less code needed outside the class.

    Thanks again.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  26. #26
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Drawing gray rectangle instead of actually resizing

    Yes, feel free to extend it to your needs (that's what it's for). Personally I will not add any new features to this at the moment since I wrote it as a reply to this thread but I don't need it myself at the moment. However I will post this as it is in the code bank.

  27. #27

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    I stayed up way too late last night working on it. I merged your most recent version withe changes I made and I will post it later today (I am at school right now).

    Changes I changed/added:
    * Added horizontal support
    * Added properties (Full Box/Line, Enabled, Width)
    * Geared the whole thing towards an MDI form that is using this on a class on an alignable control and a narrow picture box.
    * Geared the picturebox towards being places on the MDI form instead of on the picture box.

    Still working on:
    * Making a Min and Max property that work properly.
    * Getting the full box to be drawn horizontally (currently only draws the line)
    Last edited by eyeRmonkey; Oct 13th, 2005 at 11:21 AM.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  28. #28

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    Okay here is my updated version with all the changes I mentioned in my last couple replies.

    Now I am having some problems getting the full box to draw when it is aligned right top or bottom (left works fine). Joacim, I was wondering if you could skim through the code and fix the full box option for right, top and bottom. I would really appriciate it. Everything else works fine as far as I can tell excpet it could use some error checking here and there.
    Attached Files Attached Files
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  29. #29

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Drawing gray rectangle instead of actually resizing

    And once again vbAcc comes to our rescue. I have been trying to put this whole thing into a control for a while, and little did I know it was already done for me (except not in a control...):

    Splitting MDI forms:
    http://www.vbaccelerator.com/home/VB...ms/article.asp

    Splitting an SDI form:
    http://www.vbaccelerator.com/home/VB...ay/article.asp

    Drawing dotted lines:
    http://www.vbaccelerator.com/home/VB...es/article.asp

    If someone could help me throw the code from the second link into a control I would really appriciate it, but I will try to do it myself.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  30. #30
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Drawing gray rectangle instead of actually resizing

    This post has probably been resolved but just in case someone is searching for a code to create a pane splitter, take a look at this code.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  31. #31

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: [RESOLVED] Drawing gray rectangle instead of actually resizing

    Thanks Mark!

    But the vbAccelerator code I posted in post #29 solved everything with great ease. vbAccelerator rocks. I use code from all over their site now. Its wonderful.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width