Windows forms animation...I can make a new window slide to the right of the mainform...but how can i make one slide from the bottom down?
//here have...id extrasiteinfo form slide open bottom of mainform.....this code here mainform..
public partial class extrasiteinfo : form { //constants const int aw_slide = 0x40000; const int aw_hor_positive = 0x1; const int aw_hor_negative = 0x2; const int aw_blend = 0x80000; const int aw_hide = 0x1; [dllimport("user32")] static extern bool animatewindow(intptr hwnd, int time, int flags); //this receive data "form1" super sick! public extrasiteinfo(textbox t) { initializecomponent(); this.lid3tb.text = t.text; info_.focus(); } public extrasiteinfo() { initializecomponent(); } protected override void onload(eventargs e) { //load form @ position of main form int widthofmain = application.openforms["mainform"].width; int heightofmain = application.openforms["mainform"].height; int locationmainx = application.openforms["mainform"].location.x; int locationmainy = application.openforms["mainform"].location.y; //set location this.location = new point(locationmainx + widthofmain, locationmainy + 1); //animate form animatewindow(this.handle, 500, aw_slide | aw_hor_positive); }
yet 1 has me kinda stumped...here have...
this on mainform
public partial class mainform : form { //constants const int aw_slide = 0x40000; const int aw_hor_positive = 0x1; const int aw_hor_negative = 0x2; const int aw_blend = 0x80000; [dllimport("user32")] static extern bool animatewindow(intptr hwnd, int time, int flags); public mainform() { initializecomponent(); }
the button click fires second form...
private void button1_click_2(object sender, eventargs e) { bool isopen = false; formcollection fc = application.openforms; foreach (form f in fc) { if (f.name == "form1") { isopen = true; f.focus(); break; } } if (isopen == false) { extrasiteinfo form = new extrasiteinfo(this.lidtb); form.show(); } }
ok...now on form animates right of mainform...
public partial class extrasiteinfo : form { //constants const int aw_slide = 0x40000; const int aw_hor_positive = 0x1; const int aw_hor_negative = 0x2; const int aw_blend = 0x80000; const int aw_hide = 0x1; [dllimport("user32")] static extern bool animatewindow(intptr hwnd, int time, int flags); //this receive data "form1" super sick! public extrasiteinfo(textbox t) { initializecomponent(); this.lid3tb.text = t.text; info_.focus(); } public extrasiteinfo() { initializecomponent(); } protected override void onload(eventargs e) { //load form @ position of main form int widthofmain = application.openforms["mainform"].width; int heightofmain = application.openforms["mainform"].height; int locationmainx = application.openforms["mainform"].location.x; int locationmainy = application.openforms["mainform"].location.y; //set location this.location = new point(locationmainx + widthofmain, locationmainy + 1); //animate form animatewindow(this.handle, 500, aw_slide | aw_hor_positive); }
well in nut shell thats it.....can help?? need slide open bottom of mainform.....help!!
loving life since 1981 preston lambeth
hi ptiwstp1.
have reason use old win32 style of code c++ , vb6 time instead of location (point) controls in mainform?
if use in windows form using windows forms timer animated effect.
success
cor
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment