PDA

View Full Version : سوال: فرم كشويي



repo20
سه شنبه 13 بهمن 1388, 22:27 عصر
سلام دوستان
مي خواهم يه كه فرم برنامه اي كه نوشته ام حالت كشويي داشته باشه يعني از پايين به بالا يا از راست به چپ شروع كنه به باز شدن تا كامل بشه شبيه عكس زير.
لطفا سورس بديد نه راهنمايي و كمك و راه حل.

hamidreza20
چهارشنبه 14 بهمن 1388, 04:43 صبح
سلام دوست عزیز
بهتر بود خودت یه امتحان میکردی ، یا یه کم سرچ می کردی شاید پیدا می شد. ولی دوست عزیز سعی کن به راهنمایی های دوستان توجه کنی تا بتونی برنامه نویس بشی.
از قدیم گفتن سعی کن ماهیگیری یاد بدی تا اینکه به افراد ماهی بدی...

اگه بخوای برات می نویسیم میذارم ولی یه راهنمایی می کنم شاید خودت بتوی بنویسی

میای یه تایمر برای فرمت میزاری بعد خاصیت طول و عرض فرمت رو صفر می کنی و بعد کم کم مثلا 10 تا 10 تا اضافه می کنی.

التماس دعا...

repo20
چهارشنبه 14 بهمن 1388, 14:07 عصر
سلام دوست عزیز
بهتر بود خودت یه امتحان میکردی ، یا یه کم سرچ می کردی شاید پیدا می شد. ولی دوست عزیز سعی کن به راهنمایی های دوستان توجه کنی تا بتونی برنامه نویس بشی.
از قدیم گفتن سعی کن ماهیگیری یاد بدی تا اینکه به افراد ماهی بدی...

اگه بخوای برات می نویسیم میذارم ولی یه راهنمایی می کنم شاید خودت بتوی بنویسی

میای یه تایمر برای فرمت میزاری بعد خاصیت طول و عرض فرمت رو صفر می کنی و بعد کم کم مثلا 10 تا 10 تا اضافه می کنی.

التماس دعا...

سلام
منم اينقدر ها هم آماده خور نيستم همه كارايي كه گفتي را قبلا خودم انجام دادم :لبخندساده:
مشكل من فقط در اينه كه چطوري فرم رو در گوشه پايين سمت راست صفحه نمايش بدم.
بازم از راهنمايي تون ممنون.

H2K
چهارشنبه 14 بهمن 1388, 17:17 عصر
Aniumation Class code

class AnimateClass
{/// <summary>
/// Animates the window from left to right. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_HOR_POSITIVE = 0X1;
/// <summary>
/// Animates the window from right to left. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_HOR_NEGATIVE = 0X2;
/// <summary>
/// Animates the window from top to bottom. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_VER_POSITIVE = 0X4;
/// <summary>
/// Animates the window from bottom to top. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_VER_NEGATIVE = 0X8;
/// <summary>
/// Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used.
/// </summary>
public const int AW_CENTER = 0X10;
/// <summary>
/// Hides the window. By default, the window is shown.
/// </summary>
public const int AW_HIDE = 0X10000;
/// <summary>
/// Activates the window.
/// </summary>
public const int AW_ACTIVATE = 0X20000;
/// <summary>
/// Uses slide animation. By default, roll animation is used.
/// </summary>
public const int AW_SLIDE = 0X40000;
/// <summary>
/// Uses a fade effect. This flag can be used only if hwnd is a top-level window.
/// </summary>
public const int AW_BLEND = 0X80000;
///
///
///
public const int test = 0X56989;
/// <summary>
/// Animates a window.
/// </summary>
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int AnimateWindow(IntPtr hwand, int dwTime, int dwFlags);
}

Ex code for opening Form below:

int flags = AnimateClass.AW_ACTIVATE | AnimateClass.AW_CENTER;
int duration = 500;
Form f = new Form();
f.SetContent(duration, flags);
f.Show();


code for loading the new form:

AnimateClass.AnimateWindow(this.Handle, duration, flags);

repo20
چهارشنبه 14 بهمن 1388, 17:47 عصر
Aniumation Class code

class AnimateClass
{/// <summary>
/// Animates the window from left to right. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_HOR_POSITIVE = 0X1;
/// <summary>
/// Animates the window from right to left. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_HOR_NEGATIVE = 0X2;
/// <summary>
/// Animates the window from top to bottom. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_VER_POSITIVE = 0X4;
/// <summary>
/// Animates the window from bottom to top. This flag can be used with roll or slide animation.
/// </summary>
public const int AW_VER_NEGATIVE = 0X8;
/// <summary>
/// Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used.
/// </summary>
public const int AW_CENTER = 0X10;
/// <summary>
/// Hides the window. By default, the window is shown.
/// </summary>
public const int AW_HIDE = 0X10000;
/// <summary>
/// Activates the window.
/// </summary>
public const int AW_ACTIVATE = 0X20000;
/// <summary>
/// Uses slide animation. By default, roll animation is used.
/// </summary>
public const int AW_SLIDE = 0X40000;
/// <summary>
/// Uses a fade effect. This flag can be used only if hwnd is a top-level window.
/// </summary>
public const int AW_BLEND = 0X80000;
///
///
///
public const int test = 0X56989;
/// <summary>
/// Animates a window.
/// </summary>
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int AnimateWindow(IntPtr hwand, int dwTime, int dwFlags);
}

Ex code for opening Form below:

int flags = AnimateClass.AW_ACTIVATE | AnimateClass.AW_CENTER;
int duration = 500;
Form f = new Form();
f.SetContent(duration, flags);
f.Show();


code for loading the new form:

AnimateClass.AnimateWindow(this.Handle, duration, flags);



كلاس Aniumation را ايجاد كردم ولي نميدونم كد قسمت Ex code for opening Form below و code for loading the new form و را كجا بنويسم.
لطفا كمك كنيد.

cccccccccc
چهارشنبه 14 بهمن 1388, 18:16 عصر
سلام
ممنون h2k
میشه بگین برای بسته شدنش به صورت کشویی چیکار کنیم؟

H2K
چهارشنبه 14 بهمن 1388, 18:19 عصر
سلام

برای تست که ببینی‌ چطوریه :
۱.این کد رو بذار تو یه Button در فرم۱



int flags = AnimateClass.AW_ACTIVATE | AnimateClass.AW_CENTER;
int duration = 500;
Form2 f = new Form2(flags,duration);
f.Show();

۲. این کد رو هم بذار تو لود فرم ۲



AnimateClass.AnimateWindow(this.Handle, duration, flags);


نکته : این کلاس حالتهای مختلف داره برای باز و بستن فرم میتونی‌ یکی‌ یکی‌ تست کنین

H2K
چهارشنبه 14 بهمن 1388, 18:26 عصر
سلام
ممنون h2k
میشه بگین برای بسته شدنش به صورت کشویی چیکار کنیم؟
سلام

یک راهش این هست برای بستن





AnimateClass.AnimateWindow(this.Handle, 1000, AnimateClass.AW_HIDE | AnimateClass.AW_HOR_POSITIVE);
this.Close();

repo20
چهارشنبه 14 بهمن 1388, 19:41 عصر
سلام

برای تست که ببینی‌ چطوریه :
۱.این کد رو بذار تو یه Button در فرم۱



int flags = AnimateClass.AW_ACTIVATE | AnimateClass.AW_CENTER;
int duration = 500;
Form2 f = new Form2(flags,duration);
f.Show();

۲. این کد رو هم بذار تو لود فرم ۲



AnimateClass.AnimateWindow(this.Handle, duration, flags);


نکته : این کلاس حالتهای مختلف داره برای باز و بستن فرم میتونی‌ یکی‌ یکی‌ تست کنین


سلام
شرمنده.
كارايي كه گفتيد كردم ولي به flags , duration ايراد ميگيره و زيرشون خط آبي ميكشه اگه ميشه راهنمايي كنيد.
بازم شرمنده كه وقتتون را ميگيرم.:افسرده::ناراحت:

H2K
چهارشنبه 14 بهمن 1388, 20:22 عصر
سلام یه نمونه نوشتم از اینجا (http://www.codersengine.com/tutorials-forum.html?func=view&catid=8&id=251#251)میتونی‌ دانلود کنی‌
http://www.codersengine.com/images/photo/CSharp/ce_animtedform.png

repo20
پنج شنبه 15 بهمن 1388, 10:26 صبح
سلام یه نمونه نوشتم از اینجا (http://www.codersengine.com/tutorials-forum.html?func=view&catid=8&id=251#251)میتونی‌ دانلود کنی‌
http://www.codersengine.com/images/photo/CSharp/ce_animtedform.png


دوست عزيز اين صفحه لينك دانلود نداره ميشه بذاريش تو سايت تا از سايت دانلود كنم؟