I am not shure I understand the question corretly. But in asp.net pages, a Form is loaded(Form1 in your example), when user requests this page. So there will be no instance of Form2. If you have to call methods from Form2 I think you will have to use static methods
I hope this helps!
doesnt sound like the best idea, you can however put the functions in a new util class in the same namespace or namespace.Util and inlcude that in your using statements(if you use the .util one) and access that functions that way, it makes life easier 6 months down the road when you have to change a method in form 2 you wont have to worry about where else it might be called at, but you know the util class would be used in other places so debuging may be easier for you. and if for some reason you change what form 2 does or replace your function and delete it, you wont accidently break another form you werent changing, this happened to a dev we had working here a few times then he finally took my advice after he couldnt figure out what was going on, now the code behind pages are clearer, and it forced him to start thinking about how to do things generically instead of copying the same function to 15 different files... hope it helps.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
Those category names come from the System.ComponentModel.CategoryAttribute that decorate the public properties of the object being displayed in the property grid. Generally, the "Misc" category holds those properties that don't have this attribute. If you are displaying an object of your own making, then you need to add the attribute, which will move them out of "Misc". If you want to "move" other (inherited) properties, you need to override or hide them and change the attribute accordingly.
To expand categories you can do this:
PropertyGrid pg = new PropertyGrid();
pg.ExpandAllGridItems(); // Expands all the categories in the System.Windows.Forms.PropertyGrid
pg.CollapseAllGridItems(); // Collapses all the categories in the System.Windows.Forms.PropertyGrid// To expand/collapse a specific category
GridItem gi = pg.SelectedGridItem;
if (gi.GridItemType == GridItemType.Category)
gi.Expanded = true;
can someone tell me how to save a file to image file..
i want to save the fax receive from the modem to an image file to be save in the database..
is that possible??
even to convert it to msword format???
Then you can add the file name to your database or convert the image into an appropriate BLOB format.
even to convert it to msword format?
Ms Word format is for text documents. A Word document can contain images, but an image itself cannot be an Word document. I guess you want to create a document with an image on the first page. You'll find everything you need on MSDN. Look for MS Word Object Model and COM automation.