- [DEVEXPRESS] Chia sẻ source code cách tạo biểu đồ sơ đồ tổ chức công ty Org Chart trên Winform C#
- [C#] Hướng dẫn tạo Auto Number trên Datagridview winform
- [DATABASE] Hướng dẫn tạo Procedure String Split in Mysql
- [C#] Thiết lập dấu (,) hay dấu (.) ở định dạng số đúng với định dạng số Việt Nam
- [C#] Chia sẻ source code Game Spin Lucky Wheel
- [C#] Hướng dẫn Encode and Decode HTML
- Danh sách tài khoản ChatGPT miễn phí - Hướng dẫn tạo tài khoản Chat Open AI GPT tại Việt Nam
- [C#] Hướng dẫn thay đổi giao diện ứng dụng Winform theo giao diện của Windows
- [VB.NET] Hiệu ứng Acrylic, Mica, Tabbed Blur Effect trên Winform
- [DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên Combobox Edit
- [C#] Chia sẻ source code Orange Rain in Winform
- [DEVEXPRESS] Hướng dẫn sử dụng HTML Template trên XtraMessageBox Winform Devexpress 22.2.3
- [DEVEXPRESS] Hướng dẫn sử dụng HTML and CSS Code Viewer trên Winform
- [C#] Number Effect Counter up and down in winform
- [C#] Hướng dẫn Supend and Resume Process ID in Winform
- [C#] Hiển thị line number trên Richtextbox Winform
- [C#] Fake Blue Screen BSOD in winform
- [C#] Chia sẽ code demo sử dụng Async Parallel Foreach and For in Winform
- [C#] Sử dụng ActionBlock run X task at time winform
- [C#] Hướng dẫn sử dụng Property Grid để lưu và tải lại thông tin cấu hình user trên winform
Hướng dẫn viết ứng dụng thay đổi (Icon ổ đĩa máy tính) bằng VB.NET
Hôm nay, mình xin hướng dẫn các bạn thay đổi Icon ổ đĩa trong computer bằng một icon mới. Cái này chủ yếu là mình thay đổi registry trong hệ thống, cũng giống như bài hôm trước mình hướng dẫn các bạn khóa taskmanager, cài đặt ứng dụng chạy khi khởi động máy tính...
Các bạn có thể xem qua demo chương trình của mình ở dưới đây:
- Viết sự kiện thay đổi icon, khi click vào button thay đổi icon:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox1.Text = "" Then
MsgBox("Please select an icon.", MsgBoxStyle.Exclamation)
End If
If ComboBox1.SelectedItem = "" Then
MsgBox("Please select a drive letter.", MsgBoxStyle.Exclamation)
Else
My.Computer.Registry.CurrentUser.CreateSubKey("SoftwareClassesApplicationsExplorer.exeDrives" & "" & ComboBox1.SelectedItem & "" & "DefaultIcon")
My.Computer.Registry.SetValue("HKEY_CURRENT_USERSoftwareClassesApplicationsExplorer.exeDrives" & ComboBox1.SelectedItem & "" & "DefaultIcon", "", TextBox1.Text, Microsoft.Win32.RegistryValueKind.String)
MsgBox("Icon changed successfully!", MsgBoxStyle.Information)
End If
End Sub
- Viết sự kiện reset lại icon ổ đĩa mặc định của window:
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If ComboBox1.SelectedItem = "" Then
MsgBox("Please select the drive letter of which you want to reset the icon.", MsgBoxStyle.Exclamation)
Else
Try
My.Computer.Registry.CurrentUser.DeleteSubKey("SoftwareClassesApplicationsExplorer.exeDrives" & ComboBox1.SelectedItem & "" & "DefaultIcon")
My.Computer.Registry.CurrentUser.DeleteSubKey("SoftwareClassesApplicationsExplorer.exeDrives" & ComboBox1.SelectedItem)
MsgBox("Success!", MsgBoxStyle.OkOnly)
Catch ex As Exception
MsgBox("That drives icon was never changed.", MsgBoxStyle.Exclamation)
End Try
End If
End Sub
Chúc các bạn thành công!
Tải project thay đổi icon ổ đĩa bằng vb.net