|
-
Sep 7th, 2000, 02:05 PM
#1
Thread Starter
Addicted Member
ok...
once again.
1. how to resort a mshflexgrid by a col?
if i click on "name" the flexgrid resorts with ascending names.
and if i click on city the flexgrid resorts with ascending cities.
2. how to open the default email-prog, when the user clickes on a label in my app, where a e-mail adress is shown.?
thanx in advance, me
-
Sep 7th, 2000, 05:02 PM
#2
Sure thing. MsFlexGrid allows you to sort data very quickly.
Code:
Private Sub Form_Load()
Dim intCol As Integer
Dim intRow As Integer
With MSFlexGrid1
.Cols = 5
.Rows = 10
For intCol = 0 To .Cols - 1
For intRow = 1 To .Rows - 1
If intRow = 1 Then .TextMatrix(0, intCol) = "Header" & intCol + 1
.TextMatrix(intRow, intCol) = intRow & intCol
Next
Next
End With
End Sub
Private Sub MSFlexGrid1_Click()
Static blnAscend As Boolean
Dim intSortOrder As Integer
If blnAscend Then
intSortOrder = flexSortGenericAscending
Else
intSortOrder = flexSortGenericDescending
End If
With MSFlexGrid1
.Col = .Cols - 1
.Sort = intSortOrder
End With
blnAscend = Not blnAscend
End Sub
-
Sep 7th, 2000, 05:15 PM
#3
To open the Default email application with an address filled in use the ShellExecute() API, i.e.
Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Form_Load()
Label1 = "[email protected]"
End Sub
Private Sub Label1_Click()
ShellExecute 0, "OPEN", "mailto:" & Label1, "", "", 1
End Sub
-
Sep 7th, 2000, 05:41 PM
#4
Here is how to send email and also put text in the TO: SUBJECT: and BODY:.
Code:
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const SW_SHOWNORMAL = 1
Private Sub Label1_Click()
ShellExecute Me.hwnd, vbNullString, "mailto:[email protected],[email protected][email protected]&subject=whatever&body=your text", vbNullString, "c:\", SW_SHOWNORMAL
End Sub
-
Sep 8th, 2000, 05:29 AM
#5
Thread Starter
Addicted Member
malfunction?
always, when col <> colsel then vb shows a error message.
WHY
[Edited by vbAlex on 09-08-2000 at 07:31 AM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|