CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2002
    Location
    in front of computer
    Posts
    28

    resizing a user control

    i've created a user control and compiled it into ocx, the problem is that when i've added that into the control box component, the control does not resize....how could could make my compiled control resizable?

  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    What do you mean that the control does not resize? Are you talking about the USERCONTROL object or the CONTROL that you have on the USERCONTROL object? Can you post a sample OCX project that does not work?

    -Cool Bizs

  3. #3
    Join Date
    Mar 2001
    Location
    charlotte,nc
    Posts
    84
    in the vb help you will find the following as well as more examples and instruction on how to do what you are trying to do.

    "Creating an ActiveX Control"

    "Running the ShapeLabel Control at Design Time"
    ...
    To add code to the Resize event

    In the Project Explorer window, double-click ShapeLabel to make it the active designer.


    Double-click the ShapeLabel control to open the code window.


    In the Procedure box, click the Resize event to go to its event procedure. Add the following code:
    Private Sub UserControl_Resize()
    Static intCt As Integer
    intCt = intCt + 1
    Debug.Print "Resize " & intCt
    End Sub

    Note The name of the event procedure has the prefix "UserControl," just as the Form_Resize event procedure for an ordinary form has the prefix "Form."
    Elizabeth

  4. #4
    Join Date
    Oct 2002
    Location
    in front of computer
    Posts
    28

    Thumbs up

    btw, coolbiz i'm referring to the UserControl size,
    Thanks to both of you (EAK,coolbiz), i've just found a solution on that problem...

  5. #5
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    Care to share it with us?

    -Cool Bizs

  6. #6
    Join Date
    Oct 2002
    Location
    in front of computer
    Posts
    28

    sure, comrade...

    sure..
    here it is..

    I'm using a datepicker and combo box in my user control.
    The datepicker is at the back/below of the combo box.
    I'm trying to combine the capability of both controls through making this user control. I've posted a question here, since everytime i resize the UserControl, the combo box and datepicker does not resize.

    Thank you for your advice.


    '--- The code..

    Private Sub UserControl_Resize()
    Combo1.Top = UserControl.ScaleTop
    DTPicker1.Top = UserControl.ScaleTop
    Combo1.Width = UserControl.Width
    DTPicker1.Width = UserControl.Width
    UserControl.Height = Combo1.Height
    End Sub

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

Featured