Home > Net >  In the great god, vs how to click on the button you can read the text box image name, and then the r
In the great god, vs how to click on the button you can read the text box image name, and then the r

Time:09-15

In the great god, vs how to click on the button you can read the text box image name, and then the relevant images pop up in the local folders?
Everyone a great god, true white, for this thing is really not familiar with, plus a lot of code is wrong, and a little bit of deleted, I just want to click on the button, and button can read me the names of the images in the text box, and then pop up, this picture shows in another window?
Please the great god can best direct click on the button click event is given in the code, is really a little also not,,,

Programming interface and code is as follows

CodePudding user response:

CodePudding user response:

It's too hard to the great god, save the children!

CodePudding user response:

Click the query button, judge whether the image of the directory,
If any, the query results to write a constructor
 query result (string url) {use a variable to hold the url} 

Page to initialize, according to the image path,

CodePudding user response:

reference Dear200892 reply: 3/f
click the query button, judge whether the image of the directory,
If any, the query results to write a constructor
 query result (string url) {use a variable to hold the url} 

Page to initialize, according to the image path,
eldest brother... I'm sorry ha... I really don't understand... I this the code above is from the book and a little bit of try out online... You can say detailed point?

CodePudding user response:

Sorry everyone a great god, and I really is a small white, really don't understand,,, cry

CodePudding user response:

Posts don't sink!

CodePudding user response:

 string path=this. TextBox1. Text; 
If (System. IO. File. The Exists (path))
{
System. Diagnostics. The Process p=new System. Diagnostics. The Process ();
P. tartInfo. FileName=path;
P. tart ();
}
The else
{
MessageBox. Show (" no ");
}

CodePudding user response:

The
reference 7 floor Bridge_go response:
 string path=this. TextBox1. Text; 
If (System. IO. File. The Exists (path))
{
System. Diagnostics. The Process p=new System. Diagnostics. The Process ();
P. tartInfo. FileName=path;
P. tart ();
}
The else
{
MessageBox. Show (" no ");
}
, this is called the text frame's information using the code?

CodePudding user response:

Eldest brother, if I can write the code, I am willing to directly give him all my points, six or seven is right, I really hit the,,,,,,, is to CLICK on the button CLICK event in the string of code, I'm in a text box, is textbook1 text boxes,,,

CodePudding user response:

main interface
 
If (string. IsNullOrWhiteSpace (this) tbx_Url) Text. The Trim ()))//whether the path is empty
{
OpenFileDialog dialog=new OpenFileDialog ();//is empty, according to choose file dialog
Dialog. The Filter="ALL Image Files | *. *";
If (dialog. ShowDialog ()==DialogResult. OK)
{
This. Tbx_Url. Text=dialog. The FileName;//show the path to the file
}
}
Form2 form=new Form2 (this) tbx_Url) Text. The Trim ());
Form. The Show ();


display
 
Public partial class Form2: Form
{
Public Form2 ()
{
InitializeComponent();
}
///& lt; summary>
///Form2 constructor
///& lt;/summary>
///& lt; Param name="url" & gt; Image path & lt;/param>
Public Form2 (string url)
{
InitializeComponent();
This. Pic_show. Image=Image. FromFile (@ url);
}
}


Control name corresponding to the control you want to yourself, can imitate out yourself

rendering
  •  Tags:  
  • C#
  • Related