![]() |
ReportControl: Stop last being removed? |
Post Reply
|
| Author | |
ianp
Moderator Group
Joined: 19 December 2003 Location: United Kingdom Status: Offline Points: 119 |
Post Options
Thanks(0)
Quote Reply
Topic: ReportControl: Stop last being removed?Posted: 24 June 2005 at 3:58am |
|
In my report control, all columns have AllowRemove = true. I'd like to prevent my users from removing the last column, regardless of the order in which they remove the columns. Is this currently possible?
|
|
![]() |
|
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 June 2005 at 10:37am |
|
All I can suggest is to keep a global varable to keep track of how many
rows are visible to start, then increment\decrement as columns are
added\removed, then do something like this:
Private Sub wndReportControl_MouseDown(Button As Integer, Shift As Integer, X As Long, Y As Long) Dim hitColumn As ReportColumn Set hitColumn = wndReportControl.HitTest(X, Y).Column If Not hitColumn Is Nothing Then If ColumnCount <= 1 Then &nbs p; hitColumn.AllowRemove = False End If End If End Sub |
|
![]() |
|
ianp
Moderator Group
Joined: 19 December 2003 Location: United Kingdom Status: Offline Points: 119 |
Post Options
Thanks(0)
Quote Reply
Posted: 28 June 2005 at 11:09am |
|
Thanks SuperMario. I've already implemented the following code based on similar lines:
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |