How would I go about this? User Controls...

Goksly

Freshman
Joined
Aug 8, 2005
Messages
26
Hi.
Here is an example of something I want to create graphically:
table6ol.jpg


Now I think I can handle the content (i.e. get a datagrid and populate it :P) but want im after is information on how I would create the item. It needs to have the little button in the right to collapse and expand the 'mini-form', it needs to have the heading (table name) and it needs to be drag-able.

Another criteria is this has to be able to go into a form... specifically PART of a form (so im not sure if i can inherit from the windows form class as i only know of normal forms and mdi forms, not something inbetween!).

So how do I go about doing soemthing like this? Ive created user controls before, but only ones made up of a cluster of common controls -> never something that looks this unique.

Anyone got any pointers... I obviously dont expect someone to create the code etc, but just a point in the right direction... maybe some links or small code examples etc.

Thanks in advance.
 
I know it's kind of half-assed, but it's just an example you could do something along these lines.

Visual Basic:
    Public bMouseDown As Boolean = False

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
        Me.Text = e.X & "," & e.Y
        If bMouseDown = True Then
            DataGrid1.Left = e.X
            DataGrid1.Top = e.Y
        End If
        

    End Sub

    Private Sub DataGrid1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.Click
        bMouseDown = Not bMouseDown
    End Sub
 
Hi,
Er could you explain what that is actually for? The picture I gave is kind of like a form within part of a form (well thats the plan... a mdi form with a listview on the left and in the right panel MANY of these little forms).

I'm not quite sure what your code does, but what i need is pointers as to how i would create this look... I was thinking it was a form with the onpaint overridden and some how a button placed up in the right hand corner, but as I said - not sure how to do that kind of funky stuff!

Regards.
 
Goksly said:
Hi,
Er could you explain what that is actually for? The picture I gave is kind of like a form within part of a form (well thats the plan... a mdi form with a listview on the left and in the right panel MANY of these little forms).

I'm not quite sure what your code does, but what i need is pointers as to how i would create this look... I was thinking it was a form with the onpaint overridden and some how a button placed up in the right hand corner, but as I said - not sure how to do that kind of funky stuff!

Regards.

Take a look at the attached. It should give you a start.
 

Attachments

Wow! Not sure if thats a piece of code you have found, or knocked up your self but thank you! Thats very similar to what I need :)
Just will spend a bit more time defining its looks etc, but a great base. Thank you :)
 
Back
Top