|
Is there an article describing how to keep the client area of the tabControl from resizing when using flat button apperance?
tia
Rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
How can i get the actual time in c#
which will not get change even after we change system clock
*** application /pc were no internet connection
modified on Thursday, December 30, 2010 7:17 AM
|
|
|
|
|
|
thanks a lot for the reply
i am sorry i for got to update that my application don't have an internet connection
|
|
|
|
|
If you don't have internet connection, then you won't have a chance of detecting a changed system time. At least I can't think of any reasonable way. Sorry.
|
|
|
|
|
|
thanks for reply
i hope there should be some way other than using external clock..
coz applications like photoshop and all runs only 30 days ..
even if we change the system time
|
|
|
|
|
Tut, tut, you are trying to break the rules.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
The photoshop will store the latest system date it has run, if you wind back the clock before windows starts, my guess is you get a free copy of photoshop
There are a few things Photoshop possibly does to help with the problem:
- It could "calls home" to get the time off a server as well where an Internet connection is present?
- It might keep track of how long it has been running, to make sure it doesn't exceed the limit (e.g. 30 days continuous execution).
- Some cleverer algorithm, where it keeps track of when it was used, if the current date time is before the latest used date it does something
I know I've fallen foul of point three, when doing some system date specific testing: the software thought I was spoofing the date, so it ended the license immediately.
|
|
|
|
|
They use rather more sophisticated algorithms, and detect such things as the system clock having been wound back; there are things that can be done to check to see that the time is different to what is should be.
|
|
|
|
|
Buy the software, sounds like it will be cheaper.
|
|
|
|
|
Keith Barrow wrote: You could also sync with the clock in a connected GPS system, I think these need to be accurate
Not necessarily, see my post to the lounge (http://www.codeproject.com/Lounge.aspx?msg=3558840[^]) which shows real data proving the inaccurateness of a GPS unit clock.
|
|
|
|
|
Well, if the clock on the PC is wrong and you have no internet connection, its going to be hard to know what the time is. Impossible perhaps. What you do have is Environment.TickCount , which is the number of very small 'ticks' (order of tens of nanoseconds I think) since start up. If you know the time is correct when you start up, you can use this and a bit of maths to keep telling the correct time even if the clock changes.
Regards,
Rob Philpott.
|
|
|
|
|
Hello Rob
will this workout if i dont run the system regularly?
i want to implement a trial version kinda thing
for thirty days
were i dont have internet
|
|
|
|
|
No, it won't I'm afraid. That's a tricky problem but have a look around and I'm sure you'll find some discussion on it on the net. Instead of a 30 day trial, would being able to only run the app a certain number of times be an alternative?
Regards,
Rob Philpott.
|
|
|
|
|
Without an external clock source, which cannot be altered by the user, you can't do this with complete reliability.
However, you can set up a service (which must be running in order to use your app) which monitors the current time, and records it. If it is changed backwards, then it can cause a "validation failure" on your app. This can't catch every thing, and it has to be carefully done (avoid Summer time changes causing a problem, etc.) but it can be reasonably effective.
Other options:
1) Run time limited to n hours. After your app has executed for n hours, refuse to start. This tends to be more reliable (and more friendly) as people know where they are.
2) Function limited version.
To be honest, any trial protection is a pain for honest people, and a challenge for the dishonest. It generally isn't too difficult to circumvent and you can spend more on adding it to your app than you save in lost sales...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
hey guys..i want to change wordS' styles in a single cell of my datagridview
for example in a cell i have "AsdAsd.CvbCvb"..i want it to make as AsdAsd CvbCvb..to do that i declared two cellstyle
DataGridViewCellStyle mystyle1 = new DataGridViewCellStyle();
DataGridViewCellStyle mystyle2 = new DataGridViewCellStyle();
mystyle1.Font = new Font(dataGridView1.Font, FontStyle.Regular);
mystyle2.Font = new Font(dataGridView1.Font, FontStyle.Italic);
and to get the words in my cells i made this
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
for (int j = 1; j < dataGridView1.Columns.Count; j++)
{
string split = dataGridView1.Rows[i].Cells[j].Value.ToString();
string[] split2 = split.Split(new char[] { '.' });
foreach (string item in split2)
{
dataGridView1.Rows[i].Cells[j].Value = split2[0].ToString()+"/*/*" + split2[1].ToString();
}
}
}
but the point is that i dont know how to apply that styles to the words i got by splitting?
can anyone suggest me a way
vemedya.com
|
|
|
|
|
I think you can create two classes, one inheriting from DataGridViewColumn and the other one from DataGridViewCell, where you can use a RichTextBox control to show your data with the format you need. I have never done this, but I guess it is not too hard. Read the documentation about these two classes.
On the other hand, I would like to help you improve your code:
All of these lines (I have added some comments):
string split = dataGridView1.Rows[i].Cells[j].Value.ToString();
string[] split2 = split.Split(new char[] { '.' });
foreach (string item in split2)
{
dataGridView1.Rows[i].Cells[j].Value = split2[0].ToString()+"/*/*" + split2[1].ToString();
}
Give the same result as:
dataGridView1[j,i].Value = dataGridView1[j,i].Value.ToString().Replace(".", "/*/*");
But there is a difference: if you do not have a "." char, your code would also throw an exception.
|
|
|
|
|
As far as I know there is no way to do this with the 'standard' DataGridViewTextBoxColumn or DataGridViewTextBoxCell .
You can do it with the DataGridViewRichTextBoxColumn or Cell.
RichTextBox Cell in a DataGridView[^], might help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
You can't use the styles because they apply to the ENTIRE cell, not just one little piece of content in it.
You have to write your own custom DataGridViewColumn implementation to pull this off. There are examples out there, you just have to Google for something like "Custom DataGridViewColumn" for them.
|
|
|
|
|
thanks for your asnwers guys..i will look at the examples and search more deeper.. because iam not that much professional yet to create a Custom DataGridView
vemedya.com
|
|
|
|
|
Any of you geniuses know how to develop an IME (Input Method Editor) in C# or know of a good article on how to do it? I have been "Googling" for some time now and not found anything useful; mostly links on how to enable the default MS ones for textboxes, etc. I am guessing a lot of PInvoke will be involved... any ideas? I haven't got a clue where to start... :-|
Thanks
|
|
|
|
|
What do you mean by "Input Method Editor"? The basics of an editor are largely the same: read input key strokes, format the data according to the rules of the editor, display in the relevant window, save to a file as and when necessary. Google has lots of samples.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
Yes, looks like a heck of a job to me. I have already created one in WinForms, but that is application specific. I want to add something to the system tray so a user can switch between normal input and IME and the text will be entered on whatever application they are using. Oh well... a lot of homework to do then... LOL.
Thanks anyway.
|
|
|
|