P
P
pxsxmx2020-04-03 22:59:16
Python
pxsxmx, 2020-04-03 22:59:16

How to close an open pdf file when switching to a new form?

Can you please tell me how to close an open pdf-file when switching to the next form? It does not open in the form itself, but in another window. I open in Microsoft Edge. I tried to use Process::Kill, but I couldn't solve the problem, most likely I'm missing some simple things, since I'm new and just starting to figure it out. Thanks in advance.

private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
    System::Diagnostics::Process::Start("Теоретическое пособие.pdf");
  }
  private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
    this->Hide();
    //System::Diagnostics::Process::Kill("Теоретическое пособие.pdf");
    MyForm2^ myForm2 = gcnew MyForm2;
    myForm2->ShowDialog();
  }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0ralo, 2019-09-26
@MZOK

num = {
  "users": [{
    "id": 12
   }]

in your "users" is not a dictionary, but an array in which the dictionary. To get the data, either remove the square brackets, or refer to the file like thist["users"][0]["id"]

D
Dmitry Shitskov, 2019-09-26
@Zarom

Note that t["users"] is a list (array) and not a dictionary. The error hints at this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question