问题描述
C#用trackbar来进行音量控制的程序代码
解决方案
解决方案二:
[DllImport("winmm.dll")]//引用winmm.dllpublicstaticexternlongwaveOutSetVolume(uintdeviceID,uintVolume);//参数为uintprivatevoidtrackBar1_Scroll(objectsender,EventArgse){waveOutSetVolume(0,Convert.ToUInt16(trackBar1.Value));}
时间: 2024-11-26 06:16:33