Solved

rowsel in mshflexgrid

Posted on 2003-10-23
8
800 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Making a javascript parser in javascript language 3 73
scoreUp challenge 14 63
bunnyEars challenge 6 120
Programatically extract date from website 8 77
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…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
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 …

803 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