|
frmLibrarySettings getLibraryDetails = null;
and then:
loanDays = getLibraryDetails.DaysToBorrow; //getLibraryDetails still null?
??
u can't get a property value from an object that hasn't been initialized
|
|
|
|
|
Thanks for the reply,
I am coming from VB so not sure if what l am doing is correct. Do l have to initial the object in the constructor?
Any sample code would help.
Thanks for your help,
Steve
|
|
|
|
|
Make a global variabel i.e. private frmLibrarySettings getLibraryDetails;
in the constructor initialize it: frmLibrarySettings getLibraryDetails = new frmLibrarySettings(/*parameters?*/);
now u can call functions and properties on getLibraryDetails from anywhere inside the class
|
|
|
|
|
alternatively u can initialize it in the XXX_load function
|
|
|
|
|
Thanks for your help,
frmLibrarySettings getLibraryDetails = new frmLibrarySettings();
Was the answer
|
|
|
|
|
Well if I am doing that for me...I would use a simple Object Oriented approach.
1. make a local variable in your second form for the information you need to gather.
2. write 2 simple methods to get and set that information.
3. when calling the second form after all processing just write
<variable> = <form_variable>.getXXX();
for example say I have a form to get a point from the user and it have this in the second form:
...form declarations
int x;
int y;
.....
....
public void setX(int x)
{
this.x = x;
}
public int getX()
{
return x;
}
....from the other (first) form just do:
int x;
x = form2.getX();
int y;
y = form2.getY();
by the way...the set x is there so that you can manipulate it later on!
GaMBiT---> aND ReVeNGe WiLL Be
|
|
|
|
|
Hi
I have made a service in C# from where I would like to send keystrokes to the application in focus.
I have tried to use the SendKeys class calling the function
SendKeys.SendWait
When I do that I get an exception "unable to create hook"
Can anybody give me a hint how to solve that ?
Thanks
Brian
|
|
|
|
|
hi,
You cannot send keystrokes to an Interactive Session of windows from a Service. Because that (Service)runs on a diffrent session. If you need to send some response to the interactive session you can consider using sockets or some other Inter Process Communication (IPC) techiniques.
James
James Poulose
|
|
|
|
|
Hi,
Any one can Help me How to Write a Wrapper Class For third Party(Infragistics) tools,
Since I am New to this Please Help me
Regards
Prabhakar.A
Prabhakar.A
Software Engineer
|
|
|
|
|
Hi ,
Guess you can use adapter pattern for this. Can you please check the url dofactory for more info on this.
Thanks
SGS
|
|
|
|
|
Hi,
I want to ignore a class tag and serialize the object inside this ignored class. can someone help me do that. i tried using xmlignore but it ignores that class completely. instead i dont want to serialize that class as parent tag and i want the object and variable inside this class to serialize. can u help?
bye
RJ
RJ
|
|
|
|
|
Im not sure what you are talking about, sorry. Object inside? You should watch what you are saying, Intel is quick with sueing people nowadays
Cheers
Sid
|
|
|
|
|
Consider this example XML
<country>
<city>
<name>India
to serialize this i have a class "Address" which has a data member of class "Country" inside which i have a data member of class "City" and inside class "City" i have a string variable "Name". Now if i have to serialize i have to send a object of class "Address" and after serialization i get a XML as given above but i want a output as this
<city>
<name>India
i dont want "Country" tag. for this if i give XMlIgnore Attribute for "Country" it ignores everything inside this class for example "City" tag. I hope this would have made my problem clear.
|
|
|
|
|
hey the browser parses this xml example i gave above.
|
|
|
|
|
Well, at least this means its valid XML
|
|
|
|
|
Why dont you simply write your own Serializer, which would then output what you want and ignore what you dont need?
Cheers
Sid
|
|
|
|
|
thanxs...
this may be a silly question can u tell me how can i write my own serializer...
RJ
|
|
|
|
|
Generated XML
< Address >
< Country >
< City >
< Name > India </Name >
< /City >
< /Country >
< /Address >
Required XML
< Address >
< City >
< Name > India </Name >
< /City >
< /Address >
|
|
|
|
|
Hi,
I have developed an application at resolution 1024,768. I am able to adjust the form size for different resolutions, I did that, in paint event method as,
private void frmDocumentTracking_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
this.Size = new Size(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
}
But I am unable control the size of the controls in the form, I tried that by changing the Anchor property, still i am not finding the proper solution for this.
plz help me in this regard..
Regards
soman.
soman.
|
|
|
|
|
Use a LayoutManager or write one yourself.
Other than that you might want to look into panels.
OK, simply "divide" your Window into different areas, based on your customer's needs. Then use one panel per area and use the Dock-Property to get them where you need them (at this point, you MIGHT need a LayoutManager).
You then should be able to sub-divide the panels using the same technique, until you have every control where it is supposed to be.
Try resizing - if it does not work, start over
Cheers
Sid
|
|
|
|
|
The Paint Event will be called when you refresh the screen
So on SizeChanged Event
write
this.Invalidate();
|
|
|
|
|
One has to include the .NET runtime as well as Installer support in an executable assembly for taking care of the machines which do not have .NET installed on it. This makes the program (to be distributed, say on Internet) size increase by a huge margin.
My question is - suppose the assembly is converted into native code before distribution, and is then distributed (either with or without Installer ; and either installed into the Catche or otherwise), will it still require to bundle .NET runtime for supporting machine which do not have the same?
So, the question basically is will an assembly converted into native code (using ngen utility) run on a machine which does not have .NET runtime installed thereon?
|
|
|
|
|
Yes, since ngen only works for the machine it is used on.
See, if you write a program and generate an image with ngen, you cannot simply "pass" that image along. Read the docs and you will see, what I mean.
But it might be sufficient to say that ngen-images depends on processor properties, operating system, version of the operating system, version of the .net-framework and so on...
Cheers Sid.
|
|
|
|
|
Does it means that the native code prepared on one machine cannot be distributed as it will not work on another machine due to the "image" problem?
If so, then is it possible to use ngen to create the native code at the time of installation of the assembly through a setup program on the client machine? Will the .NET runtime be required to be bundled together in the setup? And, will it be a big size setup / Installer program again?
|
|
|
|
|
Basically, the problem is that the images cannot be simply copied to other computers. So the anwer would be, yes, the .NET runtime has to be installed.
Think about it: The .NET Class Library is part of the .NET Framework. Now, even IF you could simply copy the NGEN-Generated images over, you still would need to
a) Work around the PE-Executable Format
b) Work around the missing Class-Library
c) Work around Windows not knowing what to do with your image
...
The runtime-installer is not too big. Many computers already have it installed as a part of regular updates, for example, WinXP SP1 or SP2.
This may be a problem if you plan to distribute your app as "download only", which would require you to warn people about the requirement and hint them as to where they can get the .NET FW (Microsoft / WindowsUpdate).
Remember, you only need the FW - and thats about 15 MB (if I got that right).
Cheers
Sid
|
|
|
|