Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

rowsel in mshflexgrid

Posted on 2003-10-23
8
Medium Priority
?
840 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 200 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 200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

596 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