|
how i can print form?what i can use for print form?
123
|
|
|
|
|
how i can print form?and what i can use for print form?
123
|
|
|
|
|
Hai everyone,
I am using the following code in my application which is giving an error.please help me .
objMenu.objForm = this;
this.Menu = objMenu.LoadDynamicMenu();
Error 1 Cannot implicitly convert type 'object' to 'System.Windows.Forms.MainMenu'. An explicit conversion exists (are you missing a cast?)
santosh.
|
|
|
|
|
seems that LoadDynamicMenu method returns am object.
so you need to cast it like:
this.Menu = (System.Windows.Forms.MainMenu)objMenu.LoadDynamicMenu();
|
|
|
|
|
Hello.
I have some trouble with List<>. I'll give you a short example, and you'll understand, what I need.
We have a console app.
Let's do some class:
class Class4List
{
public int var;
}
Now let's do a class, that uses a List<> of already created class:
class Class4Method
{
public void changeVar(List<class4list> c4l)
{
c4l[0].var = 1;
}
}
Main:
static void Main(string[] args)
{
List<class4list> test = new List<class4list>(); //create List of our classes
Class4List qwer = new Class4List(); //create a variable with our class type
qwer.var = 25; //give some value to a class member
test.Add(qwer); //add a variable to List
Class4Method tst = new Class4Method();
tst.changeVar(new List<class4list>(test)); //calling method of a class, that uses List<class4list>
}
But after calling a method, value of test[0].var and qwer.var will be "1"! But I don't need it. I want to change value of a variable only inside of method changeVar, and outside of this method it should still be "25".
How to do this?
|
|
|
|
|
Hi!
You're adding a reference to qwer to the List, so if you access this instance in the method you can modify its properties.
If you want a copy of qwer in the list, you should take a look at IClonable .
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thank you very much!
Your advise was greatly helpful!
|
|
|
|
|
plz send me a c# project that would accept the employee details and also be able to add,update,delete records.the back end in sql...i also need the connection establishment code.send the code to bharathi_n_r@yahoo.com
thankz in advance
|
|
|
|
|
I have your project ready to go. Contact me off the board for ways to pay the $10,000 consulting fee for writing this for you.
Or, you can do your own project ( is it your job, homework or a rentacoder job gone bad ? ), and then we'd be happy to help when you're stuck.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
No bady here will send you the code.
Try to do your self. If you have any problem or you need some idea then you are always welcome .
and as i see from your profile, you have joined here 2day. so welcome to Codeproject !!!
|
|
|
|
|
Thanks dude,
The problem i face with my project is that i am not able to do update..the registration form does not contain a data grid and i want the message to be displayed in the text boxes of the respective fields when i give the phone no(primary key)....and after i insert a record and try to insert another record and if i leave any field blank it is throwing me an exception"Failed to convert parameter value from a String to a Int32."provide me a solution for this man......
|
|
|
|
|
finished The project man.Thanks for making me work with the project,otherwie i would have sit idle and sought for help.The project is working wonderfull.
|
|
|
|
|
finished The project man.Thanks for making me work with the project,otherwie i would have sit idle and sought for help.The project is working wonderfull.
Thanks
|
|
|
|
|
finished The project man.Thanks for making me work with the project,otherwie i would have sit idle and sought for help.The project is working wonderfull.
Thanks.....
|
|
|
|
|
finished The project man.Thanks for making me work with the project,otherwie i would have sit idle and sought for help.The project is working wonderfull...
Thanks.....
|
|
|
|
|
I am using a keyboard hook to stop most if not all the keys on the keyboard but i am getting this message:
CallbackOnCollectedDelegate was detected
Message: A callback was made on a garbage collected delegate of type 'Client!KeyboardHook+HookHandlerDelegate::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called.
any ideas how to solve it?
Luis E Tineo S
|
|
|
|
|
Error messages are so informative these days, that it almost gets too easy.
You have the solution handed to you in the error message already:
"When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called."
You have thrown away your reference to the delegate. Don't do that.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I'm porting my application from Window Forms to WPF, and as soon as i managed to get the first things working i run into a Random problem. I get series of several identical results in a row in WPF(the code is the same from Window Forms(where it works), i only needed to modify stuff related to getting the resource path and setting the image control). I can't see why this is happening it's totally unrelated to the code apparently. The way it's set now it can be seen when running the app and seeing identical sets of stars along the columns(it's filled that way).
Get the project here:
http://files.filefront.com/WPFMyMoOrar/;9061030;/fileinfo.html
edit:solved: it was reseeding so fast that it was getting the same time seed(so i moved the initialization of the random object to class scope), interesting that this problem didn't exist in Window Forms.
-- modified at 3:21 Saturday 17th November, 2007
|
|
|
|
|
-Hi All,
-I need to callculate an age, Which is entered in a text box.
"This thing I need to do without postback the page."
-This thng I can make with postback the page but I need it done on the spot when entered a date to a perticular text box and the next moment the Age should be calculated and entered in the another text box.
-My Date Formate is - DD/MM/YYYY
-I need only age to be calculated and displyaed in a textbox
-So something like javascript or anythig that can do so....
Please help.
-Thnks
Believe Yourself :->
|
|
|
|
|
some script on client side
SkyWalker
|
|
|
|
|
Yeah, Mircea
Exaclty Something Like That....
Can u give it?
Believe Yourself :->
|
|
|
|
|
Well, maybe if you ask in the web development forum. You are aware that C# hasn't yet made it into the client side arena?
Calling all South African developers! Your participation in this local dev community will be mutually beneficial, to you and us.
|
|
|
|
|
The other answer you got was obviously from a rocket scientist...
Why ask for javascript in the C# forum ? You want the web dev or ASP.NET forum ( although your question is not ASP.NET related as such )
http://www.google.com.au/search?sourceid=navclient&ie=UTF-8&rlz=1T4ADBS_enAU225AU226&q=javascript+calculate+age[^]
Quite a few scripts in there that will solve your problem
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
How to read contents of a file(.txt) and display it in a textbox in C# windows form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace TEST
{
public partial class Form1 : Form
{
//string connection;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog objDialog = new OpenFileDialog();
objDialog.Title = "Open .cs File";
objDialog.Filter = "C Sharp Files (*.cs)|*.cs|Text Files (*.txt)|*.txt";
objDialog.InitialDirectory = @"D:\back up d triassic\users\k\Training\ConsoleApplication1";
if (objDialog.ShowDialog() == DialogResult.OK)
{
MessageBox.Show(objDialog.FileName.ToString());
}
listBox1.Items.Add(@"D:\back up d triassic\users\k\Training\ConsoleApplication1");
read();
Open();
}
public static void Open()
{
FileStream file = new FileStream(@"D:\back up d triassic\users\k\Training\ConsoleApplication1\ConsoleApplication1\Program.cs", FileMode.Open, FileAccess.Read);
// Create a new stream to read from a file
StreamReader sr = new StreamReader(file);
// Read contents of file into a string
string s = sr.ReadToEnd();
// Close StreamReader
sr.Close();
}
public static void read()
{
FileStream file = new FileStream(@"D:\back up d triassic\users\k\Training\ConsoleApplication1\ConsoleApplication1\Program.cs", FileMode.Open, FileAccess.Read);
// Create a new stream to read from a file
StreamReader sr = new StreamReader(file);
// Read contents of file into a string
string s = sr.ReadToEnd();
// Close StreamReader
sr.Close();
// Close file
file.Close();
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Am stuck here.
Can anybody help me?
j
-- modified at 7:20 Saturday 17th November, 2007
|
|
|
|
|