access a Form1 public function from static class inside Form1
Tag : chash , By : TheMoo
Date : March 29 2020, 07:55 AM
With these it helps The point of static code is that belongs to itself, rather than any other object. For this to be true, when you set something as static, everything that depends on it must also be static! This is what your error message is trying to tell you. You are declaring something as static, but in the computation of that static, you are using something that is not static. Str2Int is not tagged as static, so that is an immediate problem, and it's possible that LoadedRef is also not static. I am half-sure you actually meant to use LoadedRefrnce there, in which case you're fine, but since you spelled nothing correctly I can't be sure!
|
How can i call a method from form1 to a new class without making the method in form1 static?
Date : March 29 2020, 07:55 AM
will help you You are storing the parameter from the constructor as it's base type Form instead of it's actual type Form1. Change private static Form frm1 = null;
private static Form1 frm1 = null;
|
How can i call a method with parameter of form1 from form2 and plot on chart on form1
Tag : chash , By : Matthew Steed
Date : March 29 2020, 07:55 AM
this one helps. First of all, you should refactor your code and separate that graph plotting method in it's separate class and then you shouldn't face this situation. In your case, you can have a Form1 instance in your Form2 and using that instance call the method like Public class Form2 : Form
{
public Form1 frm1 = null;
public Form2(Form1 frm)
{
this.frm1 = frm;
}
protected void btn_click(object sender, EventArgs e)
{
frm1.Plottingmethod();
}
}
|
How to seperate declaration and implementation of a templated class with a default template parameter?
Date : March 29 2020, 07:55 AM
will help you You cannot partially specialize template functions (that's what you're doing in the first snippet). If you're asking about how to define it outside the class, try this: template <size_t S, std::enable_if_t<(S > 0), int> j>
Foo<S, j>::Foo(){}
|
Can I fill a template parameter with a nested class in this class?
Tag : cpp , By : noboruwatanabe
Date : October 14 2020, 02:22 PM
Hope that helps Well, you simply can't do that, and you've already pointed out why that is. Thinking more about logic than about syntax, since the base class definition may very well differ depending on what its template argument is, and since the base class definition may very well affect the way TestInner works, you are attempting to create a circular dependency which is just not possible in our physical reality.
|