|
hmm.. i think i know now that you want
you want to have some kind of global variable that is accessible from anywhere in you application.
the easiest way to achive it is to do the following:
public class Global
{
public static myClass PublicMember;
static Global()
{
}
}
doing this you can do this call from wherever you want:
Global.PublicMember.DoSomething();
the static constructor is called automatically before DoSomething is executed for the first time.
does that help?
greets
M@u
|
|
|
|
|
Hello,
I want to make an app that compares an image with other images stored in a folder.
More exactly the main image is an multiple choice test solved correctly and the images stored in the X folder are the tests solved by students.
I want the app to be very flexible so i was thinking at defining an area that corresponds to the correct answer and so on for every question and save the coordinates of the area in an text or XML file. Then i can import the saved areas and assign them to every solved paper and check if the number of pixels in the correctly solved paper is (<, =) then the nr of pixels in the paper.
Can you suggest me some classes or anything that might be useful??
Thanks!
|
|
|
|
|
I will show you how to compare the image in C#. ( but the way you wanna use is very strange for me..)
Stream s1,s2;<br />
<br />
<br />
if (s1.Length != s2.Length)<br />
{<br />
return false;<br />
}<br />
s1.Position = s2.Position = 0;<br />
for (int pos = 0; pos < s1.Length; pos++)<br />
{<br />
int byte1 = s1.ReadByte();<br />
int byte2 = s2.ReadByte();<br />
if (byte1 != byte2)<br />
{<br />
return false;<br />
}<br />
if (byte1 < 0) break;<br />
}<br />
return true;<br />
<br />
hope it helps.
|
|
|
|
|
I am working on Window application of Visual Studio 2.0. I want a check box column and a check box in the header of this column in a DataGridView. Later, on clicking this header check box all the corressponding check boxes should be selected or deselected as well and values of two other columns should also interchanged between them. This interchange of column values should also heppen if we checked the single check box.
Please help me out.
Thanks,
Sumeet Sharma.
-- modified at 23:53 Wednesday 7th November, 2007
|
|
|
|
|
ImageFormat format = ImageFormat.Jpeg;
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "JPEG Files(*.jpg)|*.jpg";
if (sfd.ShowDialog() == DialogResult.OK)
{
image.Image.Save(sfd.FileName, format);
}
Hai friends whrn i was using this code fro saving picture box image as jpeg it was not saving and if save and reopen the jpeg file it was balnk can any one help me out in this
|
|
|
|
|
Code looks fine. Are adding any file extensions with the file name ? Try setting sfd.AddExtension = true; .
|
|
|
|
|
Hmm, odd. Are you sure you havn't set the BackgroundImage property of the picturebox by mistake?
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Hi All,
I have a datagridview populated from a database.
i want to place a option box on the grid saying Yes/No for each row and based on the selected option box i want to populate a combobox for that row.
suppouse if yes option is selected than Combobox has values (1,2,3)
Ahmad Osama
|
|
|
|
|
Hi,
I want to create one MSI Package with following requirement
1)There should not be any entry in Add Remove entry, Control Panel
2)The MSI package should use ASMFlag.sys file in C root to determine if the agent is installed or not. If file exists, do not install. If file does not exist, install.
3) When MSI package is created, the EXE will reside in a subfolder named 'temp'.
This is very urgent requirement. Please suggest how to create MSI Package.
Thanks in Advance
|
|
|
|
|
hi frns i want to know how to exit of web application when i click on the button like application.exit(); in windows application can anybocy tell me what is the code i can write under button click event.
regards
sunil
|
|
|
|
|
To do what? Close the web browser, or end the users session? If it's the web browser, use window.close() * in the client javascript. If the session, the code behind should use Session.Abandon(); .
*If the window hasn't been opened from another browser, it won't close without prompting the user.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
thanks for u r reply but i want to close the whole window that too in code behind
|
|
|
|
|
i got the solution iused the code below
Response.Write("javascript: parent.opener=''; " +
"parent.close();");
|
|
|
|
|
Hi,
I have created two projects, One is an EXE and other one is DLL. The DLL is referanced by EXE Project. The Exe & Dll Are working fine.
I Need to hide code of dll. So I use .NET Obfuscator Community edition (Which comes with VS 2005) to Obfuscat dll. It was done successfully.
The problem is Now when I am executing Exe it generate errors about missing Classes (Those classes are Withing DLL)
What can I do for this scenario ? Is it the nature of Community Edition ?
Please help me to solve this problem.
Thanks
Dinesh
|
|
|
|
|
Are you using reflection to load those classes? I don't think the community edition is any good for this type of situation.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
Thats correct. I use reflector to see the binary. Then What can I Use for this ?
Thanks
Dinesh
|
|
|
|
|
Take a look at the ObfuscationAttribute in the System.Reflection namespace.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
How can i define IPSEC policies using C#? i have Windows XP with SP2. In fact i want to ban and allow Ip dynamically.
|
|
|
|
|
Hi all,
I was wondering if anyone could give me a push in the right direction
I am writing an application that needs to show letters. These Letters need to be updated with information about our customers from our database.
I have considered using RTF and regular expressions to find the positions to place the new data. I found a control TxTextControl but am worried that this may get a bit messy! Both in the database (storing huge RTF) and in the app.
Does anyone have any ideas on the direction I should take ??
Thanks
John
|
|
|
|
|
Well, as what you've described sounds exactly like mail merge, have you considered using Word? If you've got Word 2007 installed, you could even fill the information in by directly targeting the Word XML.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I have just been reading about the word docx (openxml) and it does sound good !
But am i able to emmbed the finished document into a c# winform ?
Thanks
John
|
|
|
|
|
Not without using a word viewer. As a quick thought though, have you considered using WPF and its support for documents? It has an inbuilt document viewer that allows you to view XPS documents. Office 2007 does allow you to save documents as XPS, so you could possibly use automation in office to generate the documents and then open them up in the DocumentViewer control.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks for the replies,
I need it embedded in the app so that I can put it out into the business and they can build up the letter by making selections e.g. a button that when clicked adds a disclaimer to the letter... these button clicks would then need to search a template document for a place holder and put in the relevant text. the docx seems to be able to do this but i need it so that the user can only manipulate the document in the app.
Any ideas
John
|
|
|
|
|
Well - the XPS solution would seem to be a goer for you. It's not trivial, but it will result in a document that you can manipulate through your code, and which renders out like a PDF. This[^] link should help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all,
I would like to know how a can get hold of the on minimize event of a form.
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|