歌曲id搜尋介面確認與關閉鍵分離
This commit is contained in:
parent
034715f55f
commit
b32a86903c
@ -4,6 +4,7 @@ using IniParser;
|
||||
using IniParser.Model;
|
||||
using System.Text;
|
||||
using DBObj;
|
||||
using System;
|
||||
|
||||
/*
|
||||
WordCountSongs -> SongIDSearch
|
||||
@ -413,7 +414,8 @@ namespace DualScreenDemo
|
||||
|
||||
// 初始化清除按鈕
|
||||
InitializeClearButtonSongIDSearch();
|
||||
|
||||
// 初始化確認按鈕
|
||||
InitializeEnterButtonSongIDSearch();
|
||||
// 初始化關閉按鈕
|
||||
InitializeCloseButtonSongIDSearch();
|
||||
}
|
||||
@ -484,6 +486,28 @@ namespace DualScreenDemo
|
||||
);
|
||||
}
|
||||
|
||||
private void InitializeEnterButtonSongIDSearch()
|
||||
{
|
||||
// 加載配置數據
|
||||
var data = LoadConfigDataforSongIDSearch();
|
||||
|
||||
// 讀取按鈕坐標
|
||||
clearButtonSongIDCoords = LoadSpecialButtonCoordinatesForSongIDSearch(data, "SpecialButtonCoordinates", "enterButtonSongIDSearch");
|
||||
|
||||
// 加載按鈕圖片(正常、鼠標懸停、鼠標按下)
|
||||
var buttonImages = LoadButtonImagesForSongIDSearch(data, "EnterButtonImagesSongID");
|
||||
|
||||
// 創建「清除」按鈕,並設置坐標、圖片及點擊事件
|
||||
clearButtonSongIDSearch = CreateSpecialButtonForSongIDSearch(
|
||||
"btnEnterSongIDSearch", // 按鈕名稱
|
||||
clearButtonSongIDCoords, // 按鈕坐標
|
||||
buttonImages.normal, // 正常狀態圖片
|
||||
buttonImages.mouseOver, // 鼠標懸停圖片
|
||||
buttonImages.mouseDown, // 鼠標按下圖片
|
||||
CloseButtonSongIDSearch_Click // 按鈕點擊事件
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 處理「清除」按鈕的點擊事件,該事件會清空輸入框中的所有文本。
|
||||
/// </summary>
|
||||
@ -512,7 +536,6 @@ namespace DualScreenDemo
|
||||
|
||||
// 加載按鈕圖片(正常、鼠標懸停、鼠標按下)
|
||||
var buttonImages = LoadButtonImagesForSongIDSearch(data, "CloseButtonImagesSongID");
|
||||
|
||||
// 創建「關閉」按鈕,並設置坐標、圖片及點擊事件
|
||||
closeButtonSongIDSearch = CreateSpecialButtonForSongIDSearch(
|
||||
"btnCloseSongIDSearch", // 按鈕名稱
|
||||
@ -520,7 +543,7 @@ namespace DualScreenDemo
|
||||
buttonImages.normal, // 正常狀態圖片
|
||||
buttonImages.mouseOver, // 鼠標懸停圖片
|
||||
buttonImages.mouseDown, // 鼠標按下圖片
|
||||
CloseButtonSongIDSearch_Click // 按鈕點擊事件
|
||||
CloseButtonClick // 按鈕點擊事件
|
||||
);
|
||||
}
|
||||
|
||||
@ -533,15 +556,29 @@ namespace DualScreenDemo
|
||||
/// <param name="e">事件參數。</param>
|
||||
private void CloseButtonSongIDSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 隱藏 SongID 歌手圖片框
|
||||
pictureBoxSongIDSearch.Visible = false;
|
||||
|
||||
numberSearchSongButton.BackgroundImage = numberSearchSongNormalBackground;
|
||||
// 隱藏與 SongID 歌手相關的所有按鈕
|
||||
SetSongIDSearchAndButtonsVisibility(false);
|
||||
|
||||
|
||||
|
||||
|
||||
FindNumberSongs(); // 搜尋歌曲
|
||||
}
|
||||
private void CloseButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
pictureBoxSongIDSearch.Visible = false;
|
||||
modifyButtonSongIDSearch.Visible = false;
|
||||
clearButtonSongIDSearch.Visible = false;
|
||||
closeButtonSongIDSearch.Visible = false;
|
||||
inputBoxSongIDSearch.Visible = false;
|
||||
for(int i=0; i <= 9; i++)
|
||||
{
|
||||
numberSongIDButtonsForSongs[i].Visible = false;
|
||||
}
|
||||
// 隱藏 SongID 歌手圖片框
|
||||
numberSearchSongButton.BackgroundImage = numberSearchSongNormalBackground;
|
||||
// 隱藏與 SongID 歌手相關的所有按鈕
|
||||
|
||||
}
|
||||
private void FindNumberSongs(){
|
||||
string searchText = inputBoxSongIDSearch.Text;
|
||||
// 在這裡添加搜尋歌曲的邏輯
|
||||
@ -597,7 +634,6 @@ namespace DualScreenDemo
|
||||
BackgroundImageLayout = ImageLayout.Stretch,
|
||||
BackgroundImage = Image.FromFile(Path.Combine(Application.StartupPath, normalImagePath))
|
||||
};
|
||||
|
||||
// 設定按鈕的大小和位置
|
||||
ResizeAndPositionButton(button, coords.X, coords.Y, coords.Width, coords.Height);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user