Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the programming of playing Sound with VB.NET

Shulou Source: shulou.com Published: 2022-06-02 08:51:53 10月03日 Update

This article is about how VB.NET implements sound playback programming. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Add three button controls and write the following code:

Imports System.ComponentModel

'reference the family name System.ComponentModel

Imports System.Drawing

'reference the family name System.Drawing

Imports System.WinForms

'reference the family name System.WinForms

The purpose of referencing a family name in a VB.NET playback sound is that there is no need to write the family name when calling his subclass, such as

System.drawing.color is written as color

Public Class Form1

Inherits System.WinForms.Form

'Inherits inherits from an existing class

Get the methods defined by this class

Public Sub New ()

MyBase.New () 'mybase is the surrogate parent class mybase.new

Is to call the new procedure of the parent class, and new is a new object

Objects exist in memory, classes do not exist in memory

Form1 = Me'so the following me keyword is identified as form1

InitializeComponent () 'the following code

Is an initialization action performed when a new instance of form1 is created

Call me_load () 'this is a custom sub-procedure

End Sub

'Form overrides dispose to clean

Up the component list.

Overrides Public Sub Dispose ()

AxMMControl1.Command = "close"

To close the sound resource, this code must be placed in front of the dispose process

MyBase.Dispose () 'dispose is the cleanup object

Components.Dispose () 'empty the component

End Sub

Thank you for reading! This is the end of the article on "how to play sound programming in VB.NET". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Sound code object procedure programming memory content is in more article face good practical three size key keyword action subclass instance Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno Linux Huawei Docker