Solved

rowsel in mshflexgrid

Posted on 2003-10-23
8
787 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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.
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now