-
form1**:
using system;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
namespace windowsformsapplication1public partial class form1 : formpublic form1()
initializecomponent();
private void button1_click(object sender, eventargs e)
int startx =
int starty =
int endx =
int endy =
form2 f2 = new form2();
starty, endx, endy);
form2**:
using system;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
namespace windowsformsapplication1public partial class form2 : formpublic form2()
initializecomponent();
int sx; int sy; int ex; int ey;
public void get(int startx, int starty, int endx, int endy)
Get the data of form1, sx = startx;
sy = starty;
ex = endx;
ey = endy;
private void picturebox1_mousemove(object sender, mouseeventargs e)
Hover the mouse over the picturebox to display the picture.
graphics g;
pen p = new pen(, 2);
g = ; sx, sy, ex, ey);
-
This one you're talking about is called the owner
var b = new formb();
this (this is forma).
After that, you can manipulate the forma and the formb will always be on top of the forma and will not block your operation, but the formb will be manipulated in the same way when the forma is closed or minimized
-
There are two ways to open a form, one is showdialog (modal window) and the other is show (unmodal window), so you can use show.
-
Add a form member to b.
public form frmwina=null;
A value is then assigned before reality b.
So that there is a reference to window A in window B, and finally write in B's closing response that "but when B is closed"; Can.
-
Write directly in the form closing time of form b; Turn it all off.
-
1. Open B from A in modal mode, and then B returns a modal result, such as OK, and A can refresh it after receiving this result!
A button event!
form2 f2 = new form2();
dialogresult dr= ;
if (dr ==
elseb's button event:;;
-
It's simple.
Write the ** of the button directly, but you need an object of a form, and then it is =
-
Define an event in Form A, then Form B subscribes to the event, and then triggers the event when you click the button in Form A.
-
You check the parameters of the load method, and track to see if the path or something is correct.
-
You can call the C event directly in the A button and change Sander to the C button. Type oak.
But if you want to call C's Bi Rent Circle event, A must be able to refer to the B object...
You can store a reference to a in a...
The landlord can consider taking a look at the ** mode in the design pattern...
-
Make the click event in b static and public.
a.
-
Although there is a way to achieve the effect you want, it is best not to write ** in Form A using the click event of the button control of Form B, which does not conform to the characteristics of object-oriented encapsulation.
-
First instantiate the B form in the A form, and then call it, I don't know if you want to make the click event in B static and public.
You give it a try.
-
Hello! Not compliant with object-oriented encapsulation, but in a form.
Write the click event using the button control of the b-form ** Although there are ways to achieve the effect you want, it's best not to do it.
-
Suppose there are two forms, form1 and form2, there is button A on form1 and button B on form2, and the following ** is written in the click event of A
form2 f2=new form2();
In the click event of b, write the following **:
form1 f1=new form1();
-
I don't know what you're in, but you can use these two forms as sub-forms.
-
Write in a:
b frm=new b();
If a is the main form, it cannot be closed, but can only be hidden.
Handful; Changed to:
Your form2 constructor should be overloaded once: it should pass the textbox as an argument and it becomes: >>>More
Write in the click of button1; Then write using system in the main function; >>>More
GDI is like this, you can use any of the following methods I provide to alleviate this problem. 1. Before drawing this circle, draw a blue circle with a slightly lighter color, with a radius larger than your circle, so as to achieve the effect of blurring the edges, and add more circles (but the more the circle drawn before must have a slightly larger radius than the radius of the circle behind, and the color is slightly lighter), the better the effect. 2. Using WPF, this is not GDI but based on DX, which is more exquisite. >>>More
Register the keypress event for this textbox.
new ; >>>More
There's a function. There is a sqrt function below, for example, if you want to open a square of 4, you can use it; >>>More