Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Needs details or clarity Add details and clarify the problem by editing this post.
Improve this question
Opening an existing PDF in window form in C#
You can do it using custom event create event on form1 and hit event in form2
in form1 globe event
public event EventHandler OpenPDF;
add this code into form1 help button click event
if (OpenPDF!= null)
{
this.OpenPDF(this, null);
}
and in form 2 initialize this event in constructor
var frm1= new form1();
frm1.OpenPDF+=delegate{
axAcroPDF1.src = "File_name.pdf";
};
i think this is work
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am quite new to this and I am building an easy app in visual studio in C# which is plotting graphs and user can customize them by using checkboxes and radiobuttons. These are linked to events and when checkstate is changed, the event is called and the code do its job. But these events are called even when the checkstate was not changed and all plotted areas reload multiple times which is not very pleasant to the user. Can you please advise me how to call the event only when it is required. It's WinForms. An example is below. I want to display the output in both cases - if the bool value is true or false, the output is dependent on this and the outcome is different.
`
private void CheckBoxCountInvalid_CheckStateChanged(object sender, EventArgs e)
{
if (checkBoxCountInvalid.Checked)
countInvalid = true;
else
countInvalid = false;
ShowOutput();
}
`
An (if else) sounds like if would work fine for that problem.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
So I'm trying to make something and I know how to make topmost but how do I make it where from another tab like a settings tab make the main topmost but the check box is in a different tab then the one I want topmost?
here is the code I use for just being on the same tab.
if (!TopMost)
{
TopMost = true;
}
else
{
TopMost = false;
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I just need to execute some code. But I don't need to put it in any event handler.
Is there any posibility to do that in C# language? In particular, in Windows Form.
In other words how to execute a code beyond any event handlers like "button click", "mouse click", "timer tick" and so forth.
if (!boolA)
{
//do here something
}
else return;
You can put it in the constructor of the form or double click your form and put the code in the Load handler (although this is an event handler but it is very customary to put code here that needs to be executed before the form is shown). You can also put the code in the class named Program.cs and that code will be executed when the application starts-just put the code before you show the entry form.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have three windows forms like below images. I want to combine all three forms into one form. Which I can show fullscreen application as a one window
I can't use only one form with all the code. It has to be something like this three forms combined into one full-screen form. Is there a way to combine them?
You can do this by MDI Container
FormA formA = new FormA();
formA.IsMDIContainer = true;
FormB formB = new FormB();
formB.MDIParent = formA;
formB.Show();
FormC formC = new FormC();
formC.MDIParent = formA;
formC.Show();
and then run
formA.Show();
look at this article
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a main form, and call ShowDialog method (form2). After 2', application will logout and show form login. I want to close all form showing.
Application.OpenForm will be useful
foreach (Form f in Application.OpenForms)
{
if(f.Name != "MainFormName")
{
// don't close main form
f.Close();
}
}