|
ty very much Luc....it's work.....
so the problem was the indirection? And the out takes care of it? So i don't have to use a fixed *.
|
|
|
|
|
Now the tricky part could be what comes next: how will managed code access the content of the image?
:)
Can I answer?
System.Drawing.Image.FromHbitmap
|
|
|
|
|
Mirko1980 wrote: Image.FromHbitmap
Sure, but then why the native detour, why not just Image.FromFile(), that does accept TIFF files doesn't it?
Unless something tricky is going on in the native read function, I was expecting the OP to be interested in parts of the image file, not the entire image.
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:15 AM
|
|
|
|
|
Hello!
I've been having some issues with masked textboxes and have been unable to find a solution, so I hope one of you knowledgeable forumers can point me in the right direction.
Let's say for example I have a masked textbox and I want to restrict it to a 4digit numeric-only ID#. The Mask is set as "0000" and the PromptChar is "_". My problem arises when I run the project and enter the textbox. The | is placed at the end of the Prompt "____" and in order to input the data I want properly I need to backspace, key over, or click to the beginning of the string.
How can I have a masked textbox always place the data entry marker (what's it called?) at the beginning of the Prompt string when the textbox becomes the selected control?
Any help would be hugely appreciated. Thanks in advance!
|
|
|
|
|
use the SelectionStart property to set the position of the cursor (with nothing selected)
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
It baffles me why this property isn't actually IN the properties list for masked textboxes! Thanks william. Am I going to have to use an Enter event for every masked textbox in order to do this?
|
|
|
|
|
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.
|
|
|
|