|
-
May 29th, 2013, 06:56 PM
#1
Thread Starter
Hyperactive Member
-
May 29th, 2013, 08:24 PM
#2
Re: Custom control
Well, yes, to all of those things except the gridview. That's overkill for a simple list. I'm not sure I really understand the last in shows first thing and you're gonna have problems doing that with a table layout panel (or any other control for that matter) as it stands. You'd need to clear the panel and add all the controls running backward through a list on each occasion. Perhaps you could also come up with a Stack Table Layout Custom Control while you're at it?
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 29th, 2013, 08:56 PM
#3
Thread Starter
Hyperactive Member
Re: Custom control
Last in must show on top left, i may drop the table layout and just work with location properties. you are right I guess, this requires repositioning the objects for every new team or when a team is closed
-
May 30th, 2013, 05:04 AM
#4
Re: Custom control
I think a single column DataGridView on a UserControl can do just fine for this. You can put the close button underneath the grid on the UserControl.
-
May 30th, 2013, 08:18 PM
#5
Re: Custom control
Here's a reverse order flow panel for you. It only works with dynamically added controls but that's what you want.
vb.net Code:
Public Class ReverseFlowLayoutPanel
Inherits Panel
Private CList As New List(Of Control)
Private CLocation As Point
Sub New()
CLocation = New Point(5, 5)
End Sub
Protected Overrides Sub OnControlAdded(e As System.Windows.Forms.ControlEventArgs)
CList.Add(e.Control)
SetLocation()
MyBase.OnControlAdded(e)
End Sub
Protected Overrides Sub OnControlRemoved(e As System.Windows.Forms.ControlEventArgs)
CList.Remove(e.Control)
SetLocation()
MyBase.OnControlRemoved(e)
End Sub
Private Sub SetLocation()
For i = CList.Count - 1 To 0 Step -1
If Not Me.AutoSize AndAlso CLocation.X + CList(i).Width + 5 > Me.Width Then
CLocation.X = 5
CLocation.Y = CLocation.Y + CList(i).Height + 5
End If
CList(i).Location = CLocation
CLocation.X = CLocation.X + CList(i).Width + 5
Next
CLocation = New Point(5, 5)
End Sub
End Class
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 30th, 2013, 09:45 PM
#6
Thread Starter
Hyperactive Member
Re: Custom control
Thanks Guys, much appreciated. Devexpress xtraGrid Card view does exactly what i want in just one line of code
-
Jun 21st, 2013, 10:14 PM
#7
Thread Starter
Hyperactive Member
Re: [RESOLVED] Custom control
I ended up going with dumfiddlin suggestion, just encountring a tiny issue but i'v been pulling my hair to resolve it. after adding the custom controls into the form, see structure below,
-- Main Form
-- > Screen Form : called from Main Form on a button click (ShowDialog(me))
-- > User controls: dynamically added to Screen Form
It is all fine except, on each added User control, first cell on first row of the dataGrid seems to inherit the background of MainForm e.g. cell(0,0) backround would be the object with similar location property on MainForm, which in my case is a button, so my cell bakgnd is the button colour and a part of the button text property.
I tried me.refresh on the userControl constructer, but was no joy , any ideas ???? Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|