我正在使用ASP.net和C#。現在,我開發了一個Web應用程序。我想將當前主題更改爲Window7(IE8)中的Windows經典主題,因爲在使用其他主題時我的設計無序。我可以在運行時更改主題嗎?我可以這樣做OnPreInit()事件。請幫幫我 。如何在運行時將Window 7中的當前主題更改爲Window經典主題
與問候,
我正在使用ASP.net和C#。現在,我開發了一個Web應用程序。我想將當前主題更改爲Window7(IE8)中的Windows經典主題,因爲在使用其他主題時我的設計無序。我可以在運行時更改主題嗎?我可以這樣做OnPreInit()事件。請幫幫我 。如何在運行時將Window 7中的當前主題更改爲Window經典主題
與問候,
您應該解決您的CSS,而不是改變整個Windows主題,使其工作...
另外,您不能在客戶端上啓動一個進程從一個ASP.Net,從來沒有這裏的少非Web應用程序的答案:
編號:http://davidrobertmattson.com/wordpress/?p=48
//Sets the current theme
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.FileName = 「rundll32.exe」;
string startuppath = Application.StartupPath.ToString();
string Arguments = 「Shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /File:\」C:\\Windows\\Resources\\Themes\\Windows Classic.Theme\」";
startInfo.Arguments = Arguments;
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process exeProcess = Process.Start(startInfo))
{
exeProcess.WaitForInputIdle();
IntPtr p = exeProcess.MainWindowHandle;
ShowWindow(p, 1);
SendKeys.SendWait(「{enter}」);
}
}
catch
{
// Log error.
}
檢查[這](http://davidrobertmattson.com/wordpress/?p=48)出來。 – SimpleVar
基於另一個問題,我認爲是時候拿起一本關於ASP.Net&CSS的書了。 –
@Yorye Nathan ...非常感謝。 – GStar