|
I don't know why the control can't have some sane behaviour.
It is rather pants, btu there you go. Try writting a single Enter event handler and using it to for all your controls.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
private void txtCustID_Enter(object sender, EventArgs e)
{
txtCustID.SelectionStart = 0;
}
Am I using the property incorrectly? I'm still having the same problem.
|
|
|
|
|
You are using the property well, but on checking back you have the wrong event:
private void maskedEdit_GotFocus(object sender, EventArgs e)
{
MaskedTextBox mtb = (MaskedTextBox)sender;
mtb.SelectionStart = 0;
}
It appears that after the Enter event, the selection is set to the previous values. But if you use GotFocus it works. Just add the event handler manually after InitializeComponent in the constructor:
InitializeComponent();
maskedTextBox1.GotFocus += new EventHandler(this.maskedEdit_GotFocus);
maskedTextBox2.GotFocus += new EventHandler(this.maskedEdit_GotFocus);
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Does Thread.Sleep(0) allow the time slicer to start the next thread straight away or does it just idle the cpu in the existing thread until the next thread is scheduled to start?
Thanks, Bruce
|
|
|
|
|
The answer is here[^]
" Specify zero (0) to indicate that this thread should be suspended to allow other waiting threads to execute. Specify Infinite to block the thread indefinitely. "
|
|
|
|
|
That is how I had interpreted the MSDN info but my hardware vendor is telling me that the balance of the thread time idles the cpu before relinquishing the thread. Does anybody know if the time slicer can detect this sleep(0) to switch the time slice early?
|
|
|
|
|
Bruce Coward wrote: my hardware vendor is telling me that the balance of the thread time idles the cpu
that is nonsense. Every Thread.Sleep tells the scheduler to go and reschedule threads, i.e. continue working on the highest-priority ready thread; if the caller happens to be the only ready thread, it will continue working immediately. A scheduler is not supposed to idle until a tick occurs, when there is work to do (i.e. there are ready threads), then at least some of it should be taken on immediately. What would be the point to halt the CPU till the end of the current tick???
I have developed my share of embedded operating systems, and used some commercial ones, I've never seen one that deliberately did nothing for a while, not even Windows.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:14 AM
|
|
|
|
|
Luc Pattyn wrote: I've never seen one that deliberately did nothing for a while
What about virtually nothing?
|
|
|
|
|
PIEBALDconsult wrote: virtually nothing?
The future method Thread.Doze() is scheduled for introduction in .NET 4.5
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:14 AM
|
|
|
|
|
I was hoping for Thread.Winks ( 40 ) ;
Oh, wait, I could use an Extension Method for that... obfuscation here I come!
|
|
|
|
|
Hi Luc, your reply makes more sense to me. Cheers, Bruce
|
|
|
|
|
Hi people, i hope anybody could help me.
I have a terrible Issue with a Web Service created In Java, and i want to call it from C# but after I registered into my project, it doesn't allow me to instanciate it.
It just give me the error "type name expected, but namespace name found", when I try to.
It doesn't worth it, to write down the code, 'cause can't instanciate it.
Please, i'm desesperate, anyone who'd help me???
|
|
|
|
|
You are so funny!
I always think developers are so sweet when they're a 15 yo way out of their depth.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
why is that?
Sorry, i didn't catch it
|
|
|
|
|
mluque wrote: why is that?
Do you even have the slightest idea of how Java and/or C# work? Can you, from the most basic of principles, understand the interfacing issues between two disperate languages?
Show some effort and you might get help.
Show ignorance and all you'll receive is scorn.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Well, aparently, i don't.
that's why i came here, to a forum, so i could get some help.
And, as i can see, you don't have an answer (why don't you?)
Then, why do you came to a forum, where people like me ( or just me ), who doesn't know, are asking to the people who does know ( maybe you? )
So, are you going to help me with my doubt? or you're going to criticize everyone.
ps. just in case, if you're going to criticize. Please, don't. I think you have enough issues in your personal life to be criticized. And i think you can save energy telling me this, and using it to improve your own personal life
|
|
|
|
|
If you go to the top of the forum, you'll understand.
Give an example of the problem, try and minimise it to a few lines of code.
Create a simple single class java assembly and try to access it from c#. What happens?
Do you have a line of code that is causing an error? What is it?
Have you tried catching exceptions and writting them to standard out/err? What are they?
We are not here to do your homework. Most of us are professionals with decades, rather than days, of experience. If anyone can help you they will if you show an inckling of effort. Thirty plus years ago as a child I was regularly reminded 'ask a silly question, get a silly answer'. Just because we have computers, doesn't change a thing.
ps. I have no issues. I have no ciggies either, but that's another story.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
William, has anyone told you (due to your lame ass tone in one of your replies that I just read) that you're a complete ass? I would hope to never work with someone with such a cocky remark.
C# Software Developer
|
|
|
|
|
If your a 'developer' and you ask me a question like the one above I'd sack you on the spot.
/Twat/
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
HI,
In my report I have it divided by groups. I added a Recorod Number (Special Field) to Section 3 (Details).
For some reason I get a recored count for all recoreds. I would like it to reset back to Zero in every new group.
Any Idea?
tnx
|
|
|
|
|
use Runing Total! instead of Record Number!
In order to reset the number of records you need to add new Runing total.
Choose a field of which will be used to count. Select method to Count.
Evaluate : each record
Reset: Every Group and choose the group header to reset the count.
just add the New runing total field to the details section and you are done.
|
|
|
|
|
Running total only works if you want the total at the bottom of the group. Now try putting it in the Header!
Make a custom function and there is a method to sum based on group (IIRC)
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
Hi!
I want to compare the contents of a compact database with a Sql Server Express database. I am guessing I have to do it with code since Express doesn't support replication (?). So I am thinking that I have to compare the Db's table by table. This is fine but my Db's are quite big with 162 tables. So I want to start by getting access to both the full Db's, meaning all tables like:
Database database = Server.Databases[DatabaseName] using Microsoft.SqlServer.Management.Smo
Can I do this with a compact database?
A reason for doing this is beside getting the ability to loop through the Db's instead of writing 162 "SELECT * FROM table"'s is that I want to use a progressBar easily (however a secondary issue). I was initially thinking of trying to fill adapters but I don't know if I can do this with SQL ("SELECT *" ).
Will be happy for any input, thanks.
|
|
|
|
|
Jacob Flarup wrote: I am guessing I have to do it with code since Express doesn't support replication
Express supports replication but not in this scenario. Express can be a subscriber if you have a Standard edition which acts as a publisher.
To the main question: I'm not sure that I would use SMO. Instead I think I would use SqlBulkCopy[^] against the Express database and use data reader against the CE database. This way I could load all the data from the CE database to the Express database (of course to different tables or even different database).
After loading the data you could use SQL (and procedures etc) to compare the contents. Of course this could be done using datasets in C# but if you have lots of data, I think the comparison will be more efficient in the database. If you have only small amounts of data you could fill one dataset from CE and another dataset from Express and compare the contents of the datatables in the datasets. SELECT * should fill a datatable nicely.
Hope this helps,
Mika
|
|
|
|
|
hi evryone
how i can show any massage before the main form is load ?
(i work in WinCE)
thank's for any help
|
|
|
|