1
I would like to know how to make a system in which automatically adds in a Flowlayoutpanel, for each file of a folder, a button with a specific event that, when clicking, starts the application. The code I know how to do is something like this:
Try
For Each file As String In My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.SpecialDirectories.MyDocuments)
Dim mbtn As New MaterialSkin.Controls.MaterialFlatButton
mbtn.Icon = (Icon.ExtractAssociatedIcon(file)).ToBitmap
mbtn.Text = My.Computer.FileSystem.GetName(file)
mbtn.Tag = file
flp.Controls.Add(mbtn)
Next
Catch ex As Exception
MsgBox(ex.ToString)
End Try
With this, I’ve been able to do everything but open the link system. And I’d also like to know how to hide the extension. I await answers :)
Unanswered..... ;-;
– YohananDiamond
;-;-;-;-;-;-;-; WHY THAT
– YohananDiamond
If this "Materialflatbutton" control has events, add one with the
AddHandler
:AddHandler mbtn.Click, AddressOf mbtn_Click
and then declare its function:Private Sub mbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
. In case you don’t bring the extension use:mbtn.Text = Path.GetFileNameWithoutExtension(fileName)
.– Ismael
@Smael, your comment is actually the answer to the question of the post, I think you should publish it as an answer...
– VBobCat