Solved

rowsel in mshflexgrid

Posted on 2003-10-23
8
810 Views
Last Modified: 2007-12-19
i made a subroutine to handle the mshflexgrid1.rowsel.
sub mshflexgrid1_mouesmove()
         with mshflexgrid1
          .rowsel=.mouserow
          end if
but there is a problem that it select the mutli rows.I mean where ever the mouse goes the rows are selectd but that's not what i want. I want to select just one row in a time like in a combo box's list.
Pls help me in this regrad.
Ali

0
Comment
Question by:ALIHAIDER1
  • 3
  • 2
8 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 50 total points
ID: 9605236
Hi ALIHAIDER1,

i am not into VB, but it seems like this page has what you are asking
http://www.vbcity.com/forums/faq.asp?fid=8&cat=MS+Access&#TID21314

....
Private Function HighlightCorrectRow() As Boolean
' Ensure that single data row is highlighted
' and that labels/text boxes show data for current row
    HighlightCorrectRow = False
    If Me.MSHFlexGrid1.Rows - Me.MSHFlexGrid1.FixedRows > 0 Then
' At least 1 data row
        If Me.MSHFlexGrid1.Row <= Me.MSHFlexGrid1.FixedRows - 1 Then
' Current row is header row so move off
            Me.MSHFlexGrid1.Row = Me.MSHFlexGrid1.FixedRows
        End If
' Ensure that only single row is highlighted
        Me.MSHFlexGrid1.RowSel = Me.MSHFlexGrid1.Row
...

else, this may be a better place to ask this question
http://oldlook.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/

Cheers!
Sunny:o)
0
 
LVL 1

Assisted Solution

by:paulott
paulott earned 50 total points
ID: 9610037
Just add a line to your code:
____________________________
sub mshflexgrid1_mouesmove()
         with mshflexgrid1
          .row = .mouserow  '  <---  Add this
          .rowsel=.mouserow
          end if
____________________________
0
 
LVL 1

Expert Comment

by:paulott
ID: 9610270
Also, if you want it to highlight the whole row (will cause MSHFlexGrid1_SelChange() to execute, but will make it look pretty), add these two after the .rowsel = .mouserow statement:

     .Col = 1
     .ColSel = .Cols - 1

Then change the FocusRect property to 0 - flexFocusNone and the HighLight property to 1 - flexHighlightAlways.
0
Independent Software Vendors: 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!

 
LVL 1

Expert Comment

by:paulott
ID: 9610298
P.S.  
.ColSel = .Cols - 1 is assuming you have one fixed column, otherwise just use .ColSel = .Cols
0
 

Author Comment

by:ALIHAIDER1
ID: 9612519
OK dear expert Paulott
            I will try the same and wil respond latter.
Ali
0
 

Author Comment

by:ALIHAIDER1
ID: 11973504
MAY I ASK SOME NEW QUESTION
I COULDN'T FIND "ASK A QUESTION" AREA.

ALI
0

Featured Post

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!

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

730 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