?
Solved

VB6 MsFlexGrid Deselect

Posted on 2005-04-21
14
Medium Priority
?
2,469 Views
Last Modified: 2008-02-26
Could someone advice me on how I could deselect (remove highlight) items from msflexgrid.

Thanks
0
Comment
Question by:oliverUK
  • 4
  • 4
  • 3
  • +1
13 Comments
 
LVL 38

Expert Comment

by:PaulHews
ID: 13834200
You should be able to change the .Row property.

MSFlexgrid1.Row = 1

However, it depends how you are doing the selecting and on the SelectionMode property.
0
 
LVL 6

Expert Comment

by:PePi
ID: 13835396
if you have a header in your flexgrid then:

MSFlexgrid1.Row = 0: MSFlexgrid1.RowSel = 0
MSFlexgrid1.Col = 0: MSFlexgrid1.ColSel = 0


HTH!


0
 
LVL 1

Expert Comment

by:mushu999
ID: 13835983
What you really want (and don't know it yet) is to use this free VB control as a replacement:

http://vcreations.net/product.asp?pID=1

It simply rocks!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:oliverUK
ID: 13840894
Pepi your method doesn`t unselect the entire table it selects the 1st cell of the header.

PaulHews the FlexGrid is set to mode 0 - flexSelectionFree, in this mode your suggestion will highlight a cell on the 1st row depending on what  MSFlexgrid1.Col is assigned......

0
 
LVL 6

Expert Comment

by:PePi
ID: 13844405
does your flexgrid have any fixed row or fixed cols ? try this:

MSFlexgrid1.Redraw = False
MSFlexgrid1.SelectionMode = flexSelectionByRow
MSFlexgrid1.Row = 0: MSFlexgrid1.RowSel = 0
MSFlexgrid1.Col = 0: MSFlexgrid1.ColSel = 0
MSFlexgrid1.SelectionMode = flexSelectionFree
MSFlexgrid1.Redraw = True
0
 
LVL 6

Assisted Solution

by:PePi
PePi earned 50 total points
ID: 13847057
actually, you can just go like this:

With MSFlexgrid1
    .Redraw = False
    .SelectionMode = flexSelectionByRow
    .SelectionMode = flexSelectionFree
    .Redraw = True
End With
0
 

Author Comment

by:oliverUK
ID: 13856704
Thanks for your posts.
Unfortunately neither suggestion has the desired effect...
0
 
LVL 1

Expert Comment

by:mushu999
ID: 14384215
FWIW, I think the points should NOT be refunded, since not only were they a "de minimus" amount, but this person also received several very useful and good answers to their question.
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 50 total points
ID: 14384431
The problem may be one of semantics.  There is no way to fully unselect a flexgrid, because .row and .col must have valid values.  However, you can make it remove the highlight that appears when multiple cells are selected, and that's what I thought he wanted.  That really is as simple as setting the row, because that resets both .rowsel and .colsel resulting in a single selected cell which will have no highlight.  It will have a focus rectangle, but only if the flexgrid is in focus.  

I'm fine with refund, I'm also fine with a split... whatever dude.


0
 

Author Comment

by:oliverUK
ID: 14385260
As I said thank you all for your efforts but no-one managed to solve the problem if anyone should get the points its Pepi/PaulHews for suggesting some real VB code.

Mushi999 supplied a fairly irrelavent link that did not answer the question, also if you don`t think the points are enough don`t complain afterwards just dont answer the question in the first place!
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 14387130
> As I said thank you all for your efforts

I would rather that the question be deleted than have this kind of "thanks."  
0
 

Author Comment

by:oliverUK
ID: 14387470
Suits me - I solved the problem myself anyway
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 14387567
What was the solution?
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question