clint 2

Hi all

how can I do this.....

if filter = "*.wmv" then

wmp.visible = true

else

wmp.visible = false........................thanks

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

tmr.Stop()

Dim ofd As New OpenFileDialog

ofd.Filter = "Media Player Files Files windows video(*.MP3;*.WMA;*.WAV;*.WMV)|*.MP3;*.WMA;*.WAV;*.WMV"

ofd.Multiselect = False

ofd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyMusic

If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then

wmp.URL = ofd.FileName

End If

End Sub




Re: Visual Basic Express Edition quickie

TilakGopi

Hi,

Hope this will do that.



If
ofd.FileName.EndsWith(".wmv") Then

wmp.visible = true
else
wmp.visible = false

End If

Thanks,

Ch.T.Gopi Kumar.






Re: Visual Basic Express Edition quickie

Lars Breiter

Try this:

Dim ofd As New OpenFileDialog
Dim FileInfo As System.IO.FileInfo
ofd.Filter = "Media Player Files Files windows video(*.MP3;*.WMA;*.WAV;*.WMV)|*.MP3;*.WMA;*.WAV;*.WMV"
ofd.Multiselect = False
ofd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyMusic
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
FileInfo = New System.IO.FileInfo(ofd.FileName)
If FileInfo.Extension.ToLower = ".wmv" Then
wmp.URL = ofd.FileName
End If
End If




Re: Visual Basic Express Edition quickie

Tall Dude

Rearrange your filter:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click

Dim ofd As New OpenFileDialog

ofd.Filter = "Music Files (*.MP3;*.WMA;*.WAV) |*.MP3;*.WMA;*.WAV)| Video files(*.WMV) |*.WMV"

ofd.Multiselect = False

ofd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyMusic

If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then

wmp.URL = ofd.FileName

If ofd.FilterIndex = 2 Then

wmp.Visible = True

Else

wmp.Visible = False

End If

End If

End Sub

End Class






Re: Visual Basic Express Edition quickie

clint

thank you all guy

I used tall dudes code......no offence

cheers

ps......tall dude

still struggling with other post.....special folders