نمایش نتایج 1 تا 20 از 20

نام تاپیک: استفاده از Theme ویندوز XP برای برنامه ها؟

  1. #1

    استفاده از Theme ویندوز XP برای برنامه ها؟

    سلام خسته نباشید دوستان.
    چگونه میتوان از امکانات theme ویندوز Xp در برنامه ها استفاده کرد.
    آموزش حوه استفاده از آن در اینترنت هست ولی من تا کنون نتوانسته ام ملا از آن استفاده کنم.
    اگر تجربه ای دارید لطفا راهنمایی کنید.
    ممنون.

  2. #2

    static void Main()
    {
    Application.EnableVisualStyles();
    Application.Run(new Form1());
    }

  3. #3
    کاربر دائمی
    تاریخ عضویت
    آبان 1383
    محل زندگی
    تهران
    پست
    133
    برای کنترل هایی که خاصیت Flat Style دارند، باید این خاصیت با مقدار system مقداردهی شود!

  4. #4
    با تشکر از تمامی دوستان.
    خیلی جالبه تمام نکاتی که در ایترت من پیدا کردم برای انجام این کار استفاده ازفایل های Manifest رو پیشهاد کرده بودند و باید ریسورس های برنامه رو دستکاری میکردیم.
    فقط یک مشکل کوچک در مورد کامپننت هایی که خاصیت Flat Style دارند :
    در مورد Button ها ، من از Image List استفاده کردم به محض اینکه FlatStyle رو برابر System میکنم تصاویر حذف شده و با مقدار دهی مجدد آنها تصویری در آنها مشاهده نمیشود.
    لطفا راهنمایی کنید.
    ممنون.

  5. #5
    دوستان کسی نظری نداره؟

  6. #6
    و برای اینکه در تولبار بتوانید آیکن بگذارید در بین دو خط کد بالا بنویسید

    Application.DoEvent

  7. #7

    Cool

    اگر اصرار دارید تا ظاهر برنامه‌های شما مانند XP‌ هماهنگ باشد، بعد از کمپایل برنامه، فایل اجرایی آنرا به برنامه StyleItXP بدهید تا همه کارها را تنظیم کند.
    فایل های ضمیمه فایل های ضمیمه

  8. #8
    باسلام . دوستان مشکل تولبار با دو راه حل بالا حل شد.( با تشکر از دوستان)
    ولی مشکل تصاویر مربوط به دکمه ها همچنان باقی است.
    تصاویر مربوط به دمه ها با تغییر فلت استایل به سیستم از بین رفته ؟!
    لطفا راهنمایی کنید.

  9. #9
    کاربر دائمی آواتار rezanew
    تاریخ عضویت
    تیر 1383
    محل زندگی
    مرز پر گهر
    پست
    126
    بعضی از کنترل ها مثل NumericUpDown چطوری xpstyle می شن؟

  10. #10
    نقل قول نوشته شده توسط khafanovich
    فقط یک مشکل کوچک در مورد کامپننت هایی که خاصیت Flat Style دارند :
    در مورد Button ها ، من از Image List استفاده کردم به محض اینکه FlatStyle رو برابر System میکنم تصاویر حذف شده و با مقدار دهی مجدد آنها تصویری در آنها مشاهده نمیشود.
    لطفا راهنمایی کنید.
    ممنون.
    لطفا راهنمایی فرمایید.

  11. #11
    یعی واقعا تا به حال به این مشکل بر نخوردید؟

  12. #12
    آقا من اینترنتو زیر و رو کردم....مثل اینکه تا به حال کسی به این مشکل دکمه و imageList بر نخورده. :D

  13. #13
    کاربر دائمی
    تاریخ عضویت
    بهمن 1382
    محل زندگی
    فعلا ایران - فعلا تهران
    پست
    2,628
    و در نسخه 2005 ویژوال استودیو تمام مسائل فرق میکنه

  14. #14
    VIP آواتار رضا عربلو
    تاریخ عضویت
    اردیبهشت 1403
    محل زندگی
    تهران
    پست
    1,597
    "آقا من اینترنتو زیر و رو کردم....مثل اینکه تا به حال کسی به این مشکل دکمه و imageList بر نخورده"

    تو سایت CodeProject.com این مشکل به چشم من خورده است.

  15. #15

  16. #16
    VIP آواتار رضا عربلو
    تاریخ عضویت
    اردیبهشت 1403
    محل زندگی
    تهران
    پست
    1,597
    این رو یادم نیست از کجا گرفته ام
    How to add Visual Styles (the Windows XP look and feel) to your C#‎ Application
    By Gildeoni Nogueira Santos
    Hello buddies! I have spending my time working a lot and haven't time to write articles or show some sample applications. This article demonstrates how to add Visual Styles to your application.
    The first way to afford Visual Styles is by the use of an XML application manifest file. This file must be in the same directory as the application itself and this file must have the same name of your application followed by the file extension ".manifest". The file must contain an attribute called "dependency" and under this attribute we must set the identity of the component our application is dependent, in this case the new "Microsoft Windows Common-Controls" version 6.0. The following example shows the appearance of this application manifest file.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ASSEMBLY manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">


    <ASSEMBLYIDENTITY p <>
    version="1.0.0.0"
    processorArchitecture="X86"
    name="MyVisualStyleApp"
    type="win32"
    />
    <DESCRIPTION>Your app description here</DESCRIPTION>
    <DEPENDENCY>
    <DEPENDENTASSEMBLY>


    <ASSEMBLYIDENTITY p <>
    type="win32"
    name="Microsoft.Windows.Common-Controls"
    version="6.0.0.0"
    processorArchitecture="X86"
    publicKeyToken="6595b64144ccf1df"
    language="*"
    />
    </DEPENDENTASSEMBLY>
    </DEPENDENCY>
    </ASSEMBLY>
    MyVisualStyleApp.exe.manifest
    If you run the sample application you will see the effect. Legacy applications can take advantage of this approach also, but on some you may experience bugs like incorrect rendering. The following table shows the description of each element in the application manifest file.
    My Assembly:
    Attribute Description

    Version Version of the manifest. The version must be in the form
    major.minor.revision.build (that is, n.n.n.n, where n < = 65535).
    processorArchitecture Processor for which your application is developed.
    Name Includes company name, product name and application name.
    Type Type of your application, such as Microsoft Win32.
    My Assembly Dependency:
    Attribute Description

    Type Type of the dependency component, such as Win32.
    Name Name of the component.
    Version Version of the component.
    processorArchitecture Processor that the component is designed for.
    publicKeyToken Key token used with this component.
    Language Language of the component.
    And the button? The button wasn't rendered like a Windows XP button. Can we apply Visual Style to the button? Yes we can. So how? Accessing Windows API and drawing the button manually. All the functions necessary to draw a Windows XP style button is in "UxTheme.dll" under the system directory. Before draw your custom control you must take care of one thing, the "UxTheme.dll" is found only in Windows XP actually, this means if you try running an application on the Windows 98 for example, your application will crash. How can I take care of this? Verifying the Windows version and ID. The following lines of code show you how to do that.
    PlatformID platformId = Environment.OSVersion.Platform;

    Version version = Environment.OSVersion.Version;
    Version targetVersion = new Version("5.1.2600.0");

    if ((version > = targetVersion) && (platformId == PlatformID.Win32NT))
    There's another thing, the user can disable Visual Styles under Windows XP and your application could crash again. And now, how can I handle this? Verifying if Visual Styles are enabled or disabled with the following piece of code.
    if (NativeMethods.IsThemeActive() == 1)
    The "IsThemeActive" method of the "UxTheme.dll" library will return the value 1 if Visual Styles are enabled or 0 if not.
    To apply the theme call the "OpenThemeData" method this way.
    hTheme = NativeMethods.OpenThemeData(this.Handle, "Button");
    "hTheme" holds the handle returned from the "OpenThemeData" method containing the Visual Style (if exists). The following methods could be used to draw Windows XP style controls.
    - DrawThemeBackground
    - DrawThemeText
    - DrawThemeParentBackground
    And don't forget to close the theme handle when you exit the program! You can do it by using "CloseThemeData" method.
    There are other controls that don't take the advantage of application manifest files, like RadioButton for example.
    You can now draw your Windows XP style control. Good programming for all of you.
    WindowsXPLook.zip (http://www.csharphelp.com/archives2/...dowsXPLook.zip)


    و یا در Code Project دنبال این تاپیک بگرد
    Adding XP Themes to Custom .NET Controls

  17. #17
    با تشکر از همه دوستان ...مثل اینکه نمیشه این کار رو در 2003 انجام داد....از همه دوستان متشکرم...
    آخههههههههههه چراااااا !!!!

  18. #18
    کاربر دائمی
    تاریخ عضویت
    بهمن 1382
    محل زندگی
    فعلا ایران - فعلا تهران
    پست
    2,628
    چرا نمیشه همین کدی که آقای مطهر دادن رو اجرا کن و تنظیماتی که سایر دوستان گفتن انجام بده حتما میشه.
    در نسخه 2005 هم به اینا احتیاج نداری و اتوماتیک این کار برات انجام میشه

  19. #19
    کاربر جدید
    تاریخ عضویت
    مرداد 1384
    محل زندگی
    tehran
    پست
    1

    شکل Xp

    سلام
    من 2 روز است عضو سایت شده ام! این ضمیمه را نگاه کنید و برای من هم توضیح بدهید که کد نویس آن چگونه این کار را کرده است!
    امید وارم به دردتان بخورد
    فایل های ضمیمه فایل های ضمیمه

  20. #20
    دوستان خسته نباشید مثل اینکه مشکل منو شما متوجه نشدید.
    بنده در فعال سازی Xp Theme مشکلی ندارم.
    در زمینه نمایش تصاویر روی toolbar Button ها هم مشکلی ندارم.

    مشکل اینه :
    وقتی Xp theme رو با توجه به نکاتی که دوستان گفتند فعال میکنیم، دکمه هایی که از Imagelist استفاده میکنند تصاویرشان از بین میروند ( دکمه های معمولی نه دکمه های toolbar )

    و تا کنون هیچ راه حلی براش پیدا نکردم.

    باز هم تاکید میکنم با راهنماییهای دوستان بنده مشکلی در زمینه فعال سازی تم ندارم. مشکل فقط مربوط به دکمه های مشود.

    اگر راه حلی دارید بسم الله ما منتظریم تا بشنویم.

تاپیک های مشابه

  1. دادن XP Theme به برنامه های VC++‎6
    نوشته شده توسط Moharram در بخش برنامه نویسی با MFC و ++Visual C
    پاسخ: 0
    آخرین پست: سه شنبه 02 بهمن 1386, 11:53 صبح
  2. نحوه ی تعویض Theme جاری سایت.
    نوشته شده توسط hdv212 در بخش گفتگو با مسئولین سایت، درخواست و پیشنهاد
    پاسخ: 1
    آخرین پست: چهارشنبه 05 دی 1386, 02:21 صبح
  3. ایجاد Theme در فرم های VB.NET
    نوشته شده توسط ir_programmer در بخش VB.NET
    پاسخ: 2
    آخرین پست: چهارشنبه 14 آذر 1386, 21:02 عصر
  4. پاسخ: 11
    آخرین پست: چهارشنبه 16 اسفند 1385, 12:59 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •