|
you can send the logintime to second
form by
form2 frm2 = new form2(logintime);
frm2.show();
you need to modify the costructor of form2 to accept the parameter.
to subtract one date from another you have to store the result in
timespan type of variable
DateTime date1=Convert.ToDateTime("20-12-1978");
DateTime date2=Convert.ToDateTime("20-12-1979");
TimeSpan date3= date2.Subtract(date1);
int days = date3.Days;
rahul
|
|
|
|
|
I searched in MSDN but not found. Please help me how to gets WINDOWS directory like "%Systemroot%" in Windows for Programming!!
Thank you for your support!
|
|
|
|
|
Environment.GetEnvironmentVariable("SYSTEMROOT") points to the Windows directory
Environment.GetFolderPath(SpecialFolder.System) includes the "system32" directory
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
my project have three form, one mdi form and two form children, from one button on form children (form1), how i can call event menuitem_click to call form children (form2). Note, i design menu on mdi form to call form children by menuitem. Help me
Thanks
|
|
|
|
|
//in any event of form2
Form1 f1 = new Form1();<br />
f1.MenuItem_Click(sender,e);
|
|
|
|
|
hi
my dataset contain 2 related tables and i want user click on datagrid cell in datagrid1 the table2's information show in datagrid2 (it is true work ).but i click the other cells of datagrid1 the dataset
don't clear and show related information of previous row . when i clear dataset.tables["table2"].clear() the follwing error show me :
Object reference not set to an instance of an object
how to solve my problem ??(i want to show only information of current row)
|
|
|
|
|
According to me, 2 DataTable objects are related, so you can not remove all rows of table2. Because table1's data is referencing to data of table2.
NPS.
|
|
|
|
|
Encouraged by the success of my last thread, here's another:
If I show() a MessageBox in my MDI app, it's hidden somewhere behind the main window and completely locks the application. I have to quit using the task manager.
The same goes for system-generated MessageBoxes, like the "Overwrite?" dialog that can pop up during a SaveFileDialog operation.
Any ideas?
Overall, I have so many problems with MDI (redrawing, keyboard input and more) that I'm considering faking the whole MDI paradigm myself instead...
|
|
|
|
|
Try to give to show() function child and main window handles.
Best regards, Alexey.
|
|
|
|
|
MessageBox.Show() only has overloads that accept one handle (actually a IWin32Window), and I tried passing the MDI form - same problem...
Or did you mean some other way?
|
|
|
|
|
Try to pass active child form handle.
Best regards, Alexey.
|
|
|
|
|
I tried with
MessageBox.Show(myMdiForm.ActiveMdiChild, "Test");
same thing... :´(
|
|
|
|
|
hi,
I use BrowserFolderDialog to pick one folder, how can i get all filenames in this folder.
Please tell me how...
thanks
|
|
|
|
|
use filter property and set filter expression to *.*
|
|
|
|
|
Use Directory.GetFiles function.
Best regards, Alexey.
|
|
|
|
|
hi all,i convert one text word (.doc) in to file(.txt),and my coding does not show any error but when the code is executed it ask for user details such as uname,pwd,domain but i didn't set any pwd for my system,i enter into my system by just pressing enter key(when it ask password)and my os is ms2000.what is the solution for this prob?
with regards
ayyp
-- modified at 5:30 Wednesday 24th May, 2006
|
|
|
|
|
Hi i know one thing about .doc and .txt formats.
each format are differ by the formatting the contents. Actually word document also having the foemat char, and some special char for new line etc.
ok,
i thing that system having authering information for MS-Office so u need to know the authering details of that MS-Office authendication.
yours.,
ranandbe
|
|
|
|
|
i want to encrypt a string then write to a file.
and then decrypt to show. how can i do.help me plz.
|
|
|
|
|
Find a sample in your VS2003 directory.
C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\QuickStart\howto\samples\cryptography\fileencrypt\cs
|
|
|
|
|
Is there any way I can set something in the project, or call a method on startup, that makes my console app start with the console being hidden? I know I can use command-line switches but I'd like to be able to control it myself.
My program is actually a window-based app, so the natural thing would be to use a Windows Application, but I need to be able to use any GUI API, not only WinForms. So, the hidden console should start up the GUI part whatever it is.
TIA
|
|
|
|
|
If you change the output type to Windows Application you are not forced to show any windows forms. Just omit the (normally designer generated) Application.Run call and your program acts like a console one (just without a console window).
|
|
|
|
|
That simple..! I was prepared to do some ugly stuff; this made my day, thanks!
|
|
|
|
|
Hi,
While i am trying to access ActiveX control in C# i am getting this exception
{"Exception of type InvalidActiveXStateException was thrown." }
whats the issue..
|
|
|
|
|
Hi folks!
Now i use the DirectX.Capture.dll to capture the live video from cable. i got one problem is to set country code to the tuner in the Autotune progress.
i know the option for this by use DirectX.Capture.Propertypage collection but it will display the TV Tuner property window but i want only that componant.If any one know about plz share with me.:->
ranandbe
-- modified at 5:40 Wednesday 24th May, 2006
|
|
|
|
|
Hi,
Is there any way to use a specific string as a variable name? I'm having multiple textfields in my program and it would be pain in the butt to edit them all separately, they have been named sort of progressively: txtMonday1,txtMonday2,txtTuesday1, txtTuesday2, etc. And I would like to copy a certain number value to all of the boxes I want it to be copied to.
private void btnCopyWeek_Click(object sender, EventArgs e) {<br />
try {<br />
double copynumber = double.Parse(this.generalAmount.Text);<br />
for (int i = 0; i < 5; ++i) {<br />
for (int k = 1; i < 3; ++k) {<br />
string day = "txt" + WeekDay(i) + k;
((TextBox)day).Text = copynumber;
}
}
}
catch(Exception x) {<br />
MessageBox.Show("Not a number!\n\r" + x.Message);<br />
}
}
private string WeekDay(int day) {<br />
string[] days = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };<br />
return days[day];<br />
}
Any ideas?
-- modified at 4:14 Wednesday 24th May, 2006
|
|
|
|