Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check if i have clicked on header column name GIORNI 1

Status
Not open for further replies.

sal21

Programmer
Joined
Apr 26, 2004
Messages
502
Location
IT
i need to check with mousdown event or mouseup event, if i have clicked on header column with the name GIORNI.

in effect i need to restrict event only if i click on GIORNI

similar in pseudo code:

if i click on GIORNI then
call my code
end if
 
 https://files.engineering.com/getfile.aspx?folder=eb707563-0db3-4732-86ba-146d6b52302d&file=Immagine.gif
Answers to previous questions of yours have provided ALL the information necessary to do this. Do you simply cut and paste what we provide to you, or do you ever try and understand and learn anything?

Stick the following into an appropriate event for the Flexgrid (e.g Click, MouseUp, MouseDown)

Code:
[COLOR=blue]    With MSFlexGrid1 [COLOR=green]' or whatever yours is called[/color]
        If .MouseRow = 0 And .TextMatrix(.MouseRow, .MouseCol) = "GIORNI" Then
            Debug.Print "run my code here" [COLOR=GREEN]' YES, THIS IS WHERE YOUR CODE COULD GO[/color]
        End If
    End With[/color]
 
tks bro.
same for listview with the same column name?
sorry.
 
Show here what have you tried....

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
sorry andy, but as usual, not idea.
 
Not even this...[ponder]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
>same for listview

No. And frankly a listview is the wrong control for this. You need to stop making things up as you go, and try designing your application properly. Otherwise you are going to dig yourself into problems - as you have been.
 
… and – if you have any users – really confuse the users. People expect certain functionality out of certain controls, and if you change it, or use wrong controls, the app becomes really hard to use.
I’ve seen an application where command buttons and option buttons (with their Style set to 1 – Graphical) are all in one place and all of them look like command buttons. Imagine users’ confusion when they use them.


---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
That being said ... consider

Code:
[COLOR=blue]Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
    Debug.Print ColumnHeader.Text
End Sub[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top