As long as you can learn something hands-3

Today, make a simple picture viewer, with winform, only use a picturebox control, when writing code, type id picturebox1 control, but not able to find, it seems not unreasonable. This control from the Control Toolbox onto the form, that is winform designer automatically generates code, looked under the designer code, but also, how the code will be able to find form1.cs's?

Lazy brains, Internet search, found someone raised a same problem, but just ask a question to answer is whether the controls in code dynamically generated, or to controls for a name, do not meet my case. There is a winform respondents simply said not to engage in, and out of date, can not find work, at least, engage in wpf.

Checked the property under control, suddenly I saw a GenerateMember attribute value is False, but bold - not the default description, useless never been to this property, do not know what, try to change True-- problem is solved!

Then go check the Microsoft documentation, had this to say:

The GenerateMember property specifies when the Windows Forms Designer generates a member variable for a component. 

Estimates are not careful this property to False the point. The questioner maybe it is the same reason.

By the way, for the respondents say winform outdated, I am not quite that it does. Although he said it may have merit, but his answer did not solve the problem of the questioner. Even winform it does not make sense, but it does not mean that the problems encountered can be avoided. For technical problems, no matter how simple, the technology involved and more old, you know, just know, do not know just do not know, this is the right attitude. Outright, does not show a high level, I can only say, you do not know the answer.

 

------------------------------------------

(Pseudo "signature")

As long as hands do, you can learn something, even if things do seem simple enough. 

Guess you like

Origin www.cnblogs.com/badnumber/p/12078836.html