Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #43190 |

    Dear users of the Xceed Discussion Forums

    Does anybody have any resizing code that works with forms that contain SmartUI components? I am using generic code from Klaus H. Probst (VB MVP) and it fails to work with SmartUI …

    On another note I’m avid user of run-time coding. I think setting properties at design-time makes adding adjustments to your program at a later time slower. As a result I set up SmartUI at run-time and do all the resizing without a 3rd-party component.

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by BitBlast (had 9376 views)

    User (Old forums)
    Member
    Post count: 23064

    Most of the time I do the resize in code too, except when using the control as a toolbar or menu.
    What problems do you have?

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by arnout (had 657 views)

    User (Old forums)
    Member
    Post count: 23064

    Well suppose you want an Outlook interface. On the left side a viewbar and on the right side a grid. Between the two components is a unvisible image which functions as a splitter. The mousecursor changes when the cursor is over it and the form is resized when the image receives a MouseDown event. Something goes horribly wrong when the mouse hovers over the SmartUI component. Also notice the strange jumps the mousecursor makes when you’re hovering over a ViewBar.

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by BitBlast (had 858 views)

    User (Old forums)
    Member
    Post count: 23064

    I have a form with a treeview style smartbar (smartTree) control at the left in a picture container (picTree) and some other controls on the right.

    I used a second picture control (picSplit) to simulate a splitterbar.

    In a module:
    <hr>
    <pre>
    ‘ SendMessage
    Public Const HTLEFT = 10
    Public Const HTRIGHT = 11
    Public Const HTTOP = 12
    Public Const HTBOTTOM = 15
    Public Const WM_NCLBUTTONDOWN = &HA1

    Public Declare Function ReleaseCapture Lib “user32” () As Long
    #If UNICODE Then
    Public Declare Function SendMessage Lib “user32” Alias “SendMessageW” (ByVal hwnd As Long, ByVal uMgs As Long, ByVal wParam As Long, lParam As Any) As Long
    #Else
    Public Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal hwnd As Long, ByVal uMgs As Long, ByVal wParam As Long, lParam As Any) As Long
    #End If
    </pre>
    In the form:
    <hr>
    <pre>
    Private Sub picSplit_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    ‘need to do this or SendMessage fails
    ReleaseCapture
    ‘Send message to start resizing picContainer
    SendMessage picTree.hwnd, WM_NCLBUTTONDOWN, HTRIGHT, ByVal &O0
    End Sub

    Private Sub picTree_Resize()
    smartTree.Move 0, 0, picTree.ScaleWidth, picTree.ScaleHeight
    End Sub
    </pre>

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by arnout (had 608 views)

    User (Old forums)
    Member
    Post count: 23064

    Arnout

    I have tried your code but it doesn’t work in my case. I have put the SmartUI control in a PictureBox though. The MousePointer still refuses to go to its normal state when you hover over the SmartUI control.

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by BitBlast (had 634 views)

    User (Old forums)
    Member
    Post count: 23064

    Any chance of sending me a stripped down project so I can see how to make it work? The resizing code I’m using works with other UI controls (written in VB) so I really don’t know what to do next.

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by BitBlast (had 620 views)

    User (Old forums)
    Member
    Post count: 23064

    Seems that you can’t attach files to a post.

    I will post the complete text of the Form1.frm
    It will only complain about a missing From1.frx, but this only contained 2 smartitems

    Form1.frm:
    <hr>
    <pre>
    VERSION 5.00
    Object = “{84F88E17-9508-403E-A0C1-BBF8CA57433B}#1.2#0”; “SmartUI2.ocx”
    Begin VB.Form Form1
    Caption = “Form1”
    ClientHeight = 5280
    ClientLeft = 60
    ClientTop = 450
    ClientWidth = 7860
    LinkTopic = “Form1”
    ScaleHeight = 5280
    ScaleWidth = 7860
    StartUpPosition = 3 ‘Windows Default
    Begin VB.PictureBox picSplitter
    Align = 3 ‘Align Left
    BackColor = &H00C0C0FF&
    BorderStyle = 0 ‘None
    Height = 5280
    Left = 1170
    ScaleHeight = 5280
    ScaleWidth = 105
    TabIndex = 1
    Top = 0
    Width = 105
    End
    Begin VB.PictureBox picContainer
    Align = 3 ‘Align Left
    Height = 5280
    Left = 0
    ScaleHeight = 5220
    ScaleWidth = 1110
    TabIndex = 0
    Top = 0
    Width = 1170
    Begin XceedSmartUI.SmartUI SmartUI1
    Height = 3300
    Left = 120
    TabIndex = 2
    Top = 885
    Width = 945
    _ExtentX = 1667
    _ExtentY = 5821
    Template = “Form1.frx”:0000
    End
    End
    End
    Attribute VB_Name = “Form1”
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Option Explicit

    ‘ SendMessage
    Private Const HTLEFT = 10
    Private Const HTRIGHT = 11
    Private Const HTTOP = 12
    Private Const HTBOTTOM = 15
    Private Const WM_NCLBUTTONDOWN = &HA1

    Private Declare Function ReleaseCapture Lib “user32” () As Long
    #If UNICODE Then
    Private Declare Function SendMessage Lib “user32” Alias “SendMessageW” (ByVal hwnd As Long, ByVal uMgs As Long, ByVal wParam As Long, lParam As Any) As Long
    #Else
    Private Declare Function SendMessage Lib “user32” Alias “SendMessageA” (ByVal hwnd As Long, ByVal uMgs As Long, ByVal wParam As Long, lParam As Any) As Long
    #End If

    Private Sub Form_Load()

    picSplitter.MousePointer = vbSizeWE
    picSplitter.Width = 2 * Screen.TwipsPerPixelX
    End Sub

    Private Sub picContainer_Resize()
    SmartUI1.Move 0, 0, picContainer.ScaleWidth, picContainer.ScaleHeight
    End Sub

    Private Sub picSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ‘need to do this or SendMessage fails
    ReleaseCapture
    ‘Send message to start resizing picContainer
    SendMessage picContainer.hwnd, WM_NCLBUTTONDOWN, HTRIGHT, ByVal &O0
    End Sub
    </pre>

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by arnout (had 488 views)

    User (Old forums)
    Member
    Post count: 23064

    Amazing, thanks a bunch Arnout. This way of resizing works very smooth and fast. I’m still a bit puzzled how to deal with a control on the right side of the splitter. I have tried:

    SendMessage picRight.hwnd, WM_NCLBUTTONDOWN, HTLEFT, ByVal &O0

    but there still goes something wrong there …

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by BitBlast (had 638 views)

    User (Old forums)
    Member
    Post count: 23064

    It’s much simpler.
    In the resize event of the PicContainer add something like this:
    <pre>
    Private Sub picContainer_Resize()
    SmartUI1.Move 0, 0, picContainer.ScaleWidth, picContainer.ScaleHeight
    picRight.Width = Me.ScaleWidth – picContainer.Width – picSplitter.Width – 2 * picContainer.Left
    End Sub
    </pre>

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by arnout (had 556 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, now I’m starting to feel really stupid. I don’t understand the code. How come that the PictureBox is resized automatically when the form gets maximized? Is it using some hidden property? Also the control on the right should move to the right instead of being covered with the left PictureBox.

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by BitBlast (had 703 views)

    User (Old forums)
    Member
    Post count: 23064

    Can you post your email address?
    If you do then I will create a small sample project with some resizing of all controls by using a splitterbar.

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by arnout (had 409 views)

    User (Old forums)
    Member
    Post count: 23064

    spamhole@pandora.be, thanks for your time 🙂

    Applies to Xceed SmartUI (ActiveX). Imported from legacy forums. Posted by BitBlast (had 10050 views)

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.