|
mrkeivan wrote: OK this code should be in my first form as a property, right ?
This code should be in the form which you are using to display the value, i.e. not the one with the property you're trying to access.
private Form1 f = new Form1();
public Form1 Form {
get {
return this.f;
}
}
This is a property definition, it defines a property called Form with type Form1 (i.e. your form). You cannot have a variable inside the get {...} construct otherwise it will be re-initialised everytime you access the property. Hence the private Form1 f declaration outside the property definition, this only creates a Form1 object once when the variable is initialised and then you can access this variable through the Form property (to get the number property you want.
NB: If you are doing the following:
One form (the "master" form) is in control of displaying the second ("input") and you want the master form to display the number property of the input form then you can do the following which is slightly simpler:
public class MasterForm : Form {
private Form1 inputForm = new Form1();
public void DisplayNumber() {
MessageBox.Show(this.inputForm.number.ToString());
}
}
This code ensures that by having the variable declared as global to the functions etc inside the MasterForm, the second Form1 is only created once.
Ed
|
|
|
|
|
So what I need to do is to create a .db file that will contain all thumbnails of pictures in the folder. I need to be able to save to this file and to load thumbnails from it.
I have to idea how to write for example several bitmaps to just one file and how to obtain them from it. Would you please help me or give links to some info?
Thanks in advance
|
|
|
|
|
You could zip al thsi thumbnalis into one file...
And then unzip when you need them.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
yeah...that looks like an option, but there still should be a way how to do it using just one file
thanks anyway
|
|
|
|
|
If you will zip all your images then you will get one file...
you can also look at pk3 or make your onw format. You just have to find out a way to split different fiels inside your file...
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
great, yeah, I think i'll try this
and one more question, do you know where can I find examples of working with archives in c#? tried to search through MSDN but had no luck
|
|
|
|
|
|
hi every body cloud you give me the fastes way to update sql view in net.2???
best regards
|
|
|
|
|
As far as I know you can only select data from a view and you can not insert/update it.
You will have to update the actuall table(s) behind the view.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi all,
I have created a Web Service on a machine and i am creating
a windows application on another machine, i want to access the web service
from the first machine in the application on another machine.
i have created 2 projects in the win Application,
one is a windows app and another is a class library
Now i want to add the web reference to the web service in the class library
to access the methods exposed by the web service
but the problem here is as the class libraries namespace is winapp.classlib
and if i add the web service reference it does not shows the webservice name when i try to access it using classlib.webservice name
but if change the namespace of the class library project
i am able to access the methods of the webservice
can anyone tell me is it a problem of namespace or something else
Please help me out
Thanks,
Pramod
|
|
|
|
|
I have a UserControl that contains the property SelectedItem. I want to expose that property at design time. The property is of type SomeClass (just an example). At design time I want the user to be able to set the SelectedItem property to ONLY one of the instances of SomeClass contained in a List. How can I go about doing this?
public class MyTestControl : UserControl
{
private List<SomeClass> myList = new List<SomeClass>();
SomeClass _mySelectedItem;
public MyTestControl()
{
myList.Add(new SomeClass());
myList.Add(new SomeClass());
myList.Add(new SomeClass());
}
[Browsable(true)]
public SomeClass SelectedItem
{
get
{
return _mySelectedItem;
}
set
{
_mySelectedItem = true;
}
}
}
-Mike.
|
|
|
|
|
I draw some PCB(printed circuit board) use float points ArrayList on panel_paint(not scrollable),
(method 1)write MouseWheel Event ,
(method 2)and use a rubber band (a focus rectangle that tracks with the mouse pointer)to amplify the graph.
however ,when I amplify the graph a few times,the OutOfMemeryException threw;The exception is more likely to throw when I use method 2.
I heard the .Net Framework has a bug in Graphics when use float array,is this true.How can I solve my question?
Thanks for your answers.
|
|
|
|
|
hi,
frendz this is sasi,i am getting date format in c#.net as mm/dd/yyy.
but i want to get it in this format...dd/mm/yyyy.
regards,
sasi
|
|
|
|
|
Specify a culture when you convert the value. Example for swedish date format (ISO 8601):
myDate.ToString(new CultureInfo(1053))
Or you can specify an exact format:
myDate.ToString("dd/MM/yyyy")
---
b { font-weight: normal; }
|
|
|
|
|
That answer seems to be fine. But someone voted it a one - I'm curious as to why. Some people are just odd!
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I guess that there are a few jealous people hanging around here! Despite that, we have a lot of talented and skillful programmers who are willing to share. If the answer benefits you, the appropriate rating should be given.
|
|
|
|
|
I guess so. It is just that a number of times I've felt so frustrated with some people or with getting inappropriate votes that I've just taken a few days away from the programming forums. I don't want to see good people who are being genuinely helpful discouraged.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I agree. Giving a good rating is like saying a value-added thank you. Most people show their gratitude one way or another. However, we always have those few who spoil it for everyone.
|
|
|
|
|
Colin Angus Mackay wrote: But someone voted it a one - I'm curious as to why.
Yeah, I normally vote ppl 5 for a short sweet correct answer, hopefully someone will take note what a good answer is
|
|
|
|
|
hi guys !
need some help...
i m using Devmail.net component for downloading mails
but while using it i m having a problem
there occurs a Stack overflow Exception while downloading
msg.MessageSource (body of message) in some mails ,becuase of it my whole application crashes and i m unable to handle it in try catch block..
can any one help me in telling how to catch this exception
i m using c# and the programming language
can anyone hlp me as i tried a lot in Devmail.net help and forum but couldnt find the solution
its urgent...
thanks
abhinav
Systweak Inc.
jaipur India..
|
|
|
|
|
Unfortunatelly as of .net 2 you cannot catch this exception.
Here is the info from .net docs:
In prior versions of the .NET Framework, your application could catch a StackOverflowException object (for example, to recover from unbounded recursion). However, that practice is currently discouraged because significant additional code is required to reliably catch a stack overflow exception and continue program execution.
Starting with the .NET Framework version 2.0, a StackOverflowException object cannot be caught by a try-catch block and the corresponding process is terminated by default. Consequently, users are advised to write their code to detect and prevent a stack overflow. For example, if your application depends on recursion use a counter or a state condition to terminate the recursive loop.
|
|
|
|
|
hello!
i have a file,written in basic and i need to run it programmaticaly from a C# program, so that i could call methods, get answeres from them, etc.
i wrote a program using CodeDomProvider, which compiles program and it`s possible tj work with methods through Assembly
BUT!!!!
it works only on *.vb
and doent want to work with *.bas, even if i remane to yo *.vb
it doesnt compile, sends error messages. Suppose, there`s another file format or something...
i strongly need to compile it!!!!!
help please
|
|
|
|
|
What dialect of BASIC is it? There are a lot of them, and the code provider in the framework only handles Microsoft Visual Basic .NET.
---
b { font-weight: normal; }
|
|
|
|
|
You do not really think there is some kind of 'magic' built into the framework which enables it to compile every sort of programming language do you? As said there are hundreds if not thousands of basic dialects...
|
|
|
|
|
I suppose thats a kind of vb script - there`re no variable declarations no namespace, just sub after sub...
is there any chance to execute a sub from that file by C# program?
|
|
|
|