Solved

rowsel in mshflexgrid

Posted on 2003-10-23
8
794 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
viewing source code from eclipse 13 89
seriesUp challenge 7 131
Line meaning 9 82
Need To Find FireFox Binary Path For Python Selenium On Windows 7 15 450
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

867 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

15 Experts available now in Live!

Get 1:1 Help Now