PDA

View Full Version : حرفه ای: ساختن تم برای برنامه و پروژه ها



mansourm
جمعه 10 آذر 1391, 17:39 عصر
اینم چند تا اسکرین شات و در پایان هم لینک دانلود سورس برنامه

فقط لازم به ذکر است بگم که در این برنامه از کامپوننت استفاده نشده و کلا کد نویسی شده

95826
95827
95828

اینم لینک دانلود سورس برنامه
http://s1.picofile.com/file/7570154729/XCoolFormTest.rar.html



و اینم لینک چند نمونه برنامه زیبا به روشهای متفاوت

http://barnamenevis.org/showthread.php?368835-%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D9%88-%DA%A9%D8%AF-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D9%87%D8%A7%DB%8C-%D8%B2%DB%8C%D8%A8%D8%A7-%D9%81%D8%B1%D9%85-%D8%B4%DB%8C%D8%B4%D9%87-%D8%A7%DB%8C-%D8%A8%D8%A7-%D9%86%D9%88%D8%B4%D8%AA%D9%87-%D9%87%D8%A7%DB%8C-%D8%A8%D8%B3%DB%8C%D8%A7%D8%B1-%D8%B2%DB%8C%D8%A8%D8%A7-%D9%85%D9%86%D9%88%D9%87%D8%A7%DB%8C-office-2007-%D9%88-login-Wpf

robocream
جمعه 10 آذر 1391, 17:48 عصر
vaaaaaaaaaaaaaaaaooooo چیکار کردی واقعا ممنون از کارهای زیبا و با ارزشتون

barnamenevisjavan
جمعه 10 آذر 1391, 18:27 عصر
ممنون از نمونه اگر مقدوره براتون روش ایجاد رو یه نموره توضیح بده فقط نمونه نمیتونه راه گشا باشه

mansourm
جمعه 10 آذر 1391, 19:39 عصر
دوست گلم برنامه open source هستش ولی چشم توضیح میدم خدمتتون
1-ابتدا رنگ ها و استایل ها رو در یک فایل XML واقع در پوشه themes ایجاد میکنیم
2- یک Class به نام XmlThemeLoader.cs ایجاد شده که فراخوانی استایل های موجود در فایل XML را انجام میدهد
3- شما در فرمی که ایجاد میکنید مثلا Form1.Designer.cs یکسری مشخصات رنگو فونت و .. را وارد می کنید

private void InitializeComponent()
{
this.SuspendLayout();
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Fuchsia;
this.ClientSize = new System.Drawing.Size(567, 400);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Name = "Form1";
this.Text = "زیبا سازی برنامه";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);

}

4- حالا برروی فرم اصلی برنامه دابل کلیک کرده و کد زیر را وارد می کنید تا فرم با تم مورد نظر ساخته شود


public partial class Form1 :XCoolForm.XCoolForm
{
private XmlThemeLoader xtl = new XmlThemeLoader();
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
this.TitleBar.TitleBarBackImage = XCoolFormTest.Properties.Resources.predator_256x25 6;
this.MenuIcon = XCoolFormTest.Properties.Resources.alien_vs_predat or_3_48x48.GetThumbnailImage(24, 24, null, IntPtr.Zero);
this.IconHolder.HolderButtons.Add(new XCoolForm.XTitleBarIconHolder.XHolderButton(XCoolF ormTest.Properties.Resources.disc_predator_48x48.G etThumbnailImage(20, 20, null, IntPtr.Zero), "Blue Winter"));
this.IconHolder.HolderButtons.Add(new XCoolForm.XTitleBarIconHolder.XHolderButton(XCoolF ormTest.Properties.Resources.alien_48x48.GetThumbn ailImage(20, 20, null, IntPtr.Zero), "Dark System"));
this.IconHolder.HolderButtons.Add(new XCoolForm.XTitleBarIconHolder.XHolderButton(XCoolF ormTest.Properties.Resources.alien_egg_48x48.GetTh umbnailImage(20, 20, null, IntPtr.Zero), "Animal Kingdom"));
this.IconHolder.HolderButtons.Add(new XCoolForm.XTitleBarIconHolder.XHolderButton(XCoolF ormTest.Properties.Resources.predator_48x48.GetThu mbnailImage(20, 20, null, IntPtr.Zero), "Valentine"));
this.IconHolder.HolderButtons[0].FrameBackImage = XCoolFormTest.Properties.Resources.disc_predator_4 8x48;
this.IconHolder.HolderButtons[1].FrameBackImage = XCoolFormTest.Properties.Resources.alien_48x48;
this.IconHolder.HolderButtons[2].FrameBackImage = XCoolFormTest.Properties.Resources.alien_egg_48x48 ;
this.IconHolder.HolderButtons[3].FrameBackImage = XCoolFormTest.Properties.Resources.predator_48x48;
this.StatusBar.BarItems.Add(new XCoolForm.XStatusBar.XBarItem(60));
this.StatusBar.BarItems.Add(new XCoolForm.XStatusBar.XBarItem(200, "INS"));
this.StatusBar.BarItems.Add(new XCoolForm.XStatusBar.XBarItem(80, "Done"));
this.StatusBar.EllipticalGlow = false;
this.XCoolFormHolderButtonClick += new XCoolFormHolderButtonClickHandler(Form1_XCoolFormH olderButtonClick);
this.TitleBar.TitleBarCaption = "برنامه نویس منصور مرادی";
xtl.ThemeForm = this;
}


5- اگر بخواهید برای کاربر حق انتخاب them را بزارید این رویداد را هم در form 1 وارد می کنیم

private void Form1_XCoolFormHolderButtonClick(XCoolForm.XCoolFo rm.XCoolFormHolderButtonClickArgs e)
{
switch (e.ButtonIndex)
{
case 0:
this.TitleBar.TitleBarBackImage = XCoolFormTest.Properties.Resources.candy_cane;
this.TitleBar.TitleBarCaption = "برنامه نویس منصور مرادی";
this.TitleBar.TitleBarFill = XCoolForm.XTitleBar.XTitleBarFill.AdvancedRenderin g;
this.TitleBar.TitleBarType = XCoolForm.XTitleBar.XTitleBarType.Rounded;

this.TitleBar.TitleBarButtons[2].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.FullFill ;
this.TitleBar.TitleBarButtons[1].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.FullFill ;
this.TitleBar.TitleBarButtons[0].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.FullFill ;

this.IconHolder.HolderButtons[0].ButtonImage = XCoolFormTest.Properties.Resources.xmas_tree.GetTh umbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[1].ButtonImage = XCoolFormTest.Properties.Resources.xmas_decoration _green.GetThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[2].ButtonImage = XCoolFormTest.Properties.Resources.xmas_decoration _red_.GetThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[3].ButtonImage = XCoolFormTest.Properties.Resources.snowman.GetThum bnailImage(20, 20, null, IntPtr.Zero);

this.IconHolder.HolderButtons[0].FrameBackImage = XCoolFormTest.Properties.Resources.xmas_tree;
this.IconHolder.HolderButtons[1].FrameBackImage = XCoolFormTest.Properties.Resources.xmas_decoration _green;
this.IconHolder.HolderButtons[2].FrameBackImage = XCoolFormTest.Properties.Resources.xmas_decoration _red_;
this.IconHolder.HolderButtons[3].FrameBackImage = XCoolFormTest.Properties.Resources.snowmansmall;
this.MenuIcon = XCoolFormTest.Properties.Resources.Snowman1.GetThu mbnailImage(30, 30, null, IntPtr.Zero);

this.StatusBar.BarBackImage = XCoolFormTest.Properties.Resources.snowman.GetThum bnailImage(80, 80, null, IntPtr.Zero); ;
this.StatusBar.BarImageAlign = XCoolForm.XStatusBar.XStatusBarBackImageAlign.Righ t;

this.StatusBar.BarItems[1].BarItemText = "Snow level: 0.5 m";
xtl.ApplyTheme(Path.Combine(Environment.CurrentDir ectory, @"..\..\Themes\BlueWinterTheme.xml"));
break;
case 1:
this.Border.BorderStyle = XCoolForm.X3DBorderPrimitive.XBorderStyle.X3D;
this.TitleBar.TitleBarType = XCoolForm.XTitleBar.XTitleBarType.Rounded;
this.TitleBar.TitleBarCaption = "برنامه نویس منصور مرادی";

this.TitleBar.TitleBarFill = XCoolForm.XTitleBar.XTitleBarFill.AdvancedRenderin g;

this.TitleBar.TitleBarButtons[2].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.UpperGlo w;
this.TitleBar.TitleBarButtons[1].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.UpperGlo w;
this.TitleBar.TitleBarButtons[0].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.UpperGlo w;

this.IconHolder.HolderButtons[3].ButtonImage = XCoolFormTest.Properties.Resources.Quake_48x48.Get ThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[2].ButtonImage = XCoolFormTest.Properties.Resources.Quake_III_Arena _48x48.GetThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[1].ButtonImage = XCoolFormTest.Properties.Resources.Quake_IV_48x48. GetThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[0].ButtonImage = XCoolFormTest.Properties.Resources.Quake_II_48x48. GetThumbnailImage(20, 20, null, IntPtr.Zero);

this.IconHolder.HolderButtons[3].FrameBackImage = XCoolFormTest.Properties.Resources.Quake_48x48;
this.IconHolder.HolderButtons[2].FrameBackImage = XCoolFormTest.Properties.Resources.Quake_III_Arena _48x48;
this.IconHolder.HolderButtons[1].FrameBackImage = XCoolFormTest.Properties.Resources.Quake_IV_48x48;
this.IconHolder.HolderButtons[0].FrameBackImage = XCoolFormTest.Properties.Resources.Quake_II_48x48;

this.MenuIcon = XCoolFormTest.Properties.Resources.GDI_256x256.Get ThumbnailImage(30, 25, null, IntPtr.Zero);
this.TitleBar.TitleBarBackImage = XCoolFormTest.Properties.Resources.Quake_IV;

this.StatusBar.BarBackImage = XCoolFormTest.Properties.Resources.Quake_256x256;
this.StatusBar.BarImageAlign = XCoolForm.XStatusBar.XStatusBarBackImageAlign.Left ;
this.StatusBar.BarItems[1].BarItemText = "Date: 12/12/2045";
xtl.ApplyTheme(Path.Combine(Environment.CurrentDir ectory, @"..\..\Themes\DarkSystemTheme.xml"));
break;
case 2:
this.Border.BorderStyle = XCoolForm.X3DBorderPrimitive.XBorderStyle.Flat;
this.TitleBar.TitleBarBackImage = XCoolFormTest.Properties.Resources.Mammooth_1;
this.TitleBar.TitleBarCaption = "برنامه نویس منصور مرادی";

this.TitleBar.TitleBarButtons[2].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.None;
this.TitleBar.TitleBarButtons[1].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.None;
this.TitleBar.TitleBarButtons[0].ButtonFillMode = XCoolForm.XTitleBarButton.XButtonFillMode.None;

this.TitleBar.TitleBarType = XCoolForm.XTitleBar.XTitleBarType.Angular;
this.MenuIcon = XCoolFormTest.Properties.Resources.Mammooth_128x12 8.GetThumbnailImage(30, 30, null, IntPtr.Zero);
this.StatusBar.EllipticalGlow = false;

this.TitleBar.TitleBarFill = XCoolForm.XTitleBar.XTitleBarFill.UpperGlow;

this.StatusBar.BarBackImage = XCoolFormTest.Properties.Resources.Funshine_Bear_1 ;
this.StatusBar.BarImageAlign = XCoolForm.XStatusBar.XStatusBarBackImageAlign.Left ;

this.StatusBar.BarItems[1].BarItemText = "Place: Madagascar";
this.StatusBar.BarItems[1].ItemTextAlign = StringAlignment.Center;

this.IconHolder.HolderButtons[0].ButtonImage = XCoolFormTest.Properties.Resources.cow_32.GetThumb nailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[1].ButtonImage = XCoolFormTest.Properties.Resources.bird_32.GetThum bnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[2].ButtonImage = XCoolFormTest.Properties.Resources.panda_32.GetThu mbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[3].ButtonImage = XCoolFormTest.Properties.Resources.penguine_32.Get ThumbnailImage(20, 20, null, IntPtr.Zero);

this.IconHolder.HolderButtons[0].FrameBackImage = XCoolFormTest.Properties.Resources.cow_32;
this.IconHolder.HolderButtons[1].FrameBackImage = XCoolFormTest.Properties.Resources.bird_32;
this.IconHolder.HolderButtons[2].FrameBackImage = XCoolFormTest.Properties.Resources.panda_32;
this.IconHolder.HolderButtons[3].FrameBackImage = XCoolFormTest.Properties.Resources.penguine_32;
xtl.ApplyTheme(Path.Combine(Environment.CurrentDir ectory, @"..\..\Themes\AnimalKingdomTheme.xml"));
break;
case 3:
this.Border.BorderStyle = XCoolForm.X3DBorderPrimitive.XBorderStyle.X3D;
this.TitleBar.TitleBarType = XCoolForm.XTitleBar.XTitleBarType.Rectangular;
this.TitleBar.TitleBarCaption = "برنامه نویس منصور مرادی";

this.TitleBar.TitleBarFill = XCoolForm.XTitleBar.XTitleBarFill.LinearRendering;

this.TitleBar.TitleBarBackImage = XCoolFormTest.Properties.Resources.heart_valentine _128x128;
this.StatusBar.EllipticalGlow = false;

this.StatusBar.BarBackImage = XCoolFormTest.Properties.Resources.paisley_6_48x48 ;
this.StatusBar.BarImageAlign = XCoolForm.XStatusBar.XStatusBarBackImageAlign.Cent er;
this.StatusBar.BarItems[1].BarItemText = "Hearts left: 4";
this.MenuIcon = XCoolFormTest.Properties.Resources.purple_flower_4 8x48.GetThumbnailImage(30, 30, null, IntPtr.Zero);

this.IconHolder.HolderButtons[0].ButtonImage = XCoolFormTest.Properties.Resources.butterfly_pink_ 48x48.GetThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[1].ButtonImage = XCoolFormTest.Properties.Resources.butterfly_purpl e_48x48.GetThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[2].ButtonImage = XCoolFormTest.Properties.Resources.lotus_48x48.Get ThumbnailImage(20, 20, null, IntPtr.Zero);
this.IconHolder.HolderButtons[3].ButtonImage = XCoolFormTest.Properties.Resources.symbol_48x48.Ge tThumbnailImage(20, 20, null, IntPtr.Zero);

this.IconHolder.HolderButtons[0].FrameBackImage = XCoolFormTest.Properties.Resources.butterfly_pink_ 48x48;
this.IconHolder.HolderButtons[1].FrameBackImage = XCoolFormTest.Properties.Resources.butterfly_purpl e_48x48;
this.IconHolder.HolderButtons[2].FrameBackImage = XCoolFormTest.Properties.Resources.lotus_48x48;
this.IconHolder.HolderButtons[3].FrameBackImage = XCoolFormTest.Properties.Resources.symbol_48x48;
xtl.ApplyTheme(Path.Combine(Environment.CurrentDir ectory, @"..\..\Themes\ValentineTheme.xml"));
break;
}
}
}

همه چیز به همین سادگس بود دیگهدنبال کامپوننت و دردسر هاش هم نگردید

robocream
شنبه 11 آذر 1391, 18:46 عصر
باسلام

ببخشید میتونم از این تم برای ساخت پلیر استفاده کنم

mansourm
یک شنبه 12 آذر 1391, 17:44 عصر
با سلام خدمت تمامی دوستان البته که میتونید این تم هستش یعنی تو هر برنامه ای و با windows xp server vista seven 7 and eight قابل اجرا میباشد

mreza80
دوشنبه 13 آذر 1391, 08:29 صبح
دوست عزیز از دو dll استفاده کردی سورس اونا رو هم میتونی در اختیار بزاری

mansourm
دوشنبه 13 آذر 1391, 19:00 عصر
دوست عزیز از دو dll استفاده کردی سورس اونا رو هم میتونی در اختیار بزاری

دوست گلم این نرم افزارو دانلود کن و هر فایل .net رو که میخواید بازکنید

JetBrains dotPeek 1.0 Full Edition
Build 1.0.0.8644 on 2012-05-09T10:29:52