|
hi all,
first: i want to show notifyicon's contextmenustrip if user clicks both right and left button of mouse ? (double <left> clicks will restore but single <left> click only shows the contextmenu)
second: if user clicks one of Minimize, Resize or Close buttons ( at right-up corner of form) i want to hide the form. only Exit button on contextmenustrip should close the the application.
how can i do the aboves ?
help please ...
|
|
|
|
|
first: search the event for mouse-click, and open a method for that, inside just write:
if ((e.Button == MouseButtons.Left) || (e.Button == MouseButtons.Right))<br />
contextMenuStrip1.Show(MousePosition);
this will check if some-one has pressed the right or left button, and will show the contextmenustrip at mouseposition.
second: again, search the events you want in the events (i.e formclosing for clicking close (X)), and open their methods, and write (this is for formclosing):
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
}
|
|
|
|
|
I am making a search engine and i want the control to shift from the query box to search button automatically i.e if user presses enter after writing the query the search button automatically get pressed.. currently user has to use mouse to press the search button...
Looking farward to your help
Regards,
|
|
|
|
|
see the AcceptButton property of your form...
|
|
|
|
|
|
I have an app that logs data and serialises a CTime to an archive
ie
<br />
CTime time<br />
<br />
achive << time<br />
I cannot for the life of me get .NET to read it from the file.
I can get the same value from the file , its just that the code below
produces a date somewhere in the 1600's
DateTime time=DataTime.FromBinary(theFileValue);
I can load the value in a C++ MFC program and get the correct result
HELP!!!! Thanks
.Netter
|
|
|
|
|
did you try to provide an IFormatProvider? This is an option which you can define how it's formatted.
|
|
|
|
|
its not the format , the date is totally incorrect, infact the date it reports is 12:01:53 AM on 1/1/0001.
Ive tried all the .From options, none work.
|
|
|
|
|
and Convert.ToDateTime() you can provide as good as everything, maybe that will help
|
|
|
|
|
in fact it just throws and invalid cast exception (as the documentation says)
|
|
|
|
|
Then i think you can use the same solution as i've just given down here:
string strDate = "20060502";
DateTime dtDate = DateTime.ParseExact( strDate, "yyyyMMdd", CultureInfo.InvariantCulture );
strDate = dtDate.ToString();
Where y stands vor years
M for months
d for days
h for hours
m for minutes
s for seconds
Should this work?
|
|
|
|
|
The value is saved in the file as an int32, not a string, the problem is that the .net datetime doesnt interpret this value the same way MFC does with CTime.
|
|
|
|
|
You say the value is saved in the file as an int32. Is it the same as time_t (which is 32 bits)? If so, the C# DateTime is obtained as follows, where the variable "timet" contains your 32 bit time_t value:
DateTime.FromFileTime(10000000 * (long)timet + 116444736000000000)
|
|
|
|
|
i can't check it at the moment but that sounds about right. So thank you very much.
Where did you fid that strange bit of information. Can't think I would have come up with that.
|
|
|
|
|
>> Where did you find that strange bit of information
It is not so strange if you analyze it. Those aren't "magical" numbers in that equation:
DateTime.FromFileTime(10000000 * (long)timet + 116444736000000000)
You can see from the method name that the quantity in parentheses is a FileTime. You already know that time_t is seconds since 1/1/1970. A FileTime is a long representing 100 nanosecond intervals since 1/1/1601. So all you need to do is multiply the time_t by 1e7 to get 100 nanosecond intervals, and then add the number of 100 nanosecond intervals between 1/1/1601 and 1/1/1970, which is easily calculated. Perfectly logical, no? Hahaha.
|
|
|
|
|
Went to work , tested and thats it.Thank you
|
|
|
|
|
how do i fill my dataset with a parameter.
i use a access database.
I use the following select command:
WHERE T075_BORGTOCHTNUMMER_1 LIKE ?
and this code i use to fill my dataset:
<br />
this.dBANBM_T075_BORGTOCHTTableAdapter.FillBy1(this.testdb1DataSet.DBANBM_T075_BORGTOCHT, textBox1.Text.ToString);<br />
The value that's in my textbox on the form is called VAL.
this VAL i put in a string.
the error he returns is:
No overload for method 'FillBy1' takes '1' arguments
I really have no idee to do this.
|
|
|
|
|
Hii,
In ASP.Net Application how can i show tool tip...
Aur any other alternative...
Thanx & Regards
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
|
I have read the artical but there is no property given in this custom control where i can give tool tip text...
Thanx
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
From the front end just add <foo title="my tooltip text" >.
Code behind: control.Attributes["title"] = "my tooltip text";
Look at NiceTitle.js to make it prettier
|
|
|
|
|
Thanx for your reply...But the way u wrote it's not Working...my side.
-- modified at 7:55 Friday 12th May, 2006
|
|
|
|
|
Hi
In an XML file, I am getting date as YYYYMMDD and time as HHMMSS.
How can I convert this date to DD-MM-YYYY or DD/MM/YYYY
and time as HH:MM:SS
Thanks for the response
|
|
|
|
|
r u reading the xml file with dataset object...
Anuj Kamthan
Software Developer
Solversa Technologies,
Pune - 411007, India.
http://www.solversa.com
|
|
|
|
|
Convert.ToDateTime( ) function will help you out
|
|
|
|