|
You're running a process, one which may or may not open a multitude of windows. The "top most" is a highly contested place; my 3G connection thinks it is the most important application on my machine, but my MP3 player sometimes has similar feelings*. It is frustrating to see them fight for focus while reading your answer.
You can enumerate which windows a process opened. Find yours, and set the WS_EX_TOPMOST[^] style.
--edit;
*) there can be only one
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I think the code in this solution to a QA question here: [^] will show you how to make the instance of NotePad.exe the top-most Window using the 'SetForeGroundWindow API call.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
What the suject says...
I can format the selection to bold and to italic. but when I want the text bold and italic the formation is set to regular automatically.
Thats my code:
newfont = FontStyle.Bold & FontStyle.Italic;
richTextBox1.SelectionFont = new Font(currentfont.FontFamily, currentfont.Size, newfont);
|
|
|
|
|
& is AND - a binary operation that returns a 1 in each bit only if the corresponding bit in both operands is 1, and a zero otherwise.
So if these are in Binary:
0011 & 1010 Will return 0010 because only the second bit has matching "1"s in the same position.
The operation you want is OR : | which returns a 1 is either corresponding bit is 1.
0011 | 1010 Will return 1011.
So try:
newfont = FontStyle.Bold | FontStyle.Italic;
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
thanks a lot it works
do you know how I can say that I will get the currentFontStyle without bold ?
so if the selection is bold and italic and now i just want it in italic?
i only want the code...
|
|
|
|
|
Use:
existingStyle & ~FontStyle.Bold That turns the bit off.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
perfect thank you so much!
|
|
|
|
|
You're welcome!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I want to customize serial port listener code to send an acknowledgement after every frame I receive, how do I change the code? please help.
|
|
|
|
|
Since you have not shown us the code, it is impossible to answer your question.
|
|
|
|
|
But surely you kn ow what code he is using? It's the same one everyone else does! You know, the one written in IBM S360/195 assembler in 1982?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Of course , I'll just get the listing out of my code cupboard.
|
|
|
|
|
Hi,
I have a c# windows application (Ticketing System) and I connect to the database on server (Primary Server) by the network, also I have another server used as a replication server (Secondary Server), my question is
How to make my application connect to the second server (Secondary) automatically if the first server not work or I can't connect to it.
I need my application to be online always with the database and it connect to the available server (try server # 1 if failed connect to server # 2).
Please help me ASAP.
Thank You
|
|
|
|
|
The obvious answer is to test if the first connection failed, and if so use the alternate. What exactly is the problem with this logic?
|
|
|
|
|
No it is not a problem but I don't want to depend on the exception when try to connect to the first server, I ask if there is any other way to check the SQL server is available or not.
|
|
|
|
|
That depends on what you mean by available, as there are many reasons why your connection could fail. But there is no way of knowing in advance which one to test for.
|
|
|
|
|
Google for "SQL Server High Availability". This really has nothing to do with your application code. Your code shouldn't care at all about each individual SQL Server and how to connect to it. All it should know is how to connect to the "cluster".
Keep in the mind that this is expensive and there is no way to reduce any servers downtime to zero. If you implement your "poor mans" solution, remember, you get exactly what you pay for. You may get a cheaper solution the way you want to do it but you also give yourself an administrative nightmare. If the list of servers changes how are you going to tell the clients that and update them?
You have no control over the client hardware, such as network interface, the quality of the connection between the client and the servers, the router and switch hardware between the client and servers, the server hardware itself, ...
There is no such thing as 100% uptime.
|
|
|
|
|
Dave Kreskowiak wrote: There is no such thing as 100% uptime What! Wait I'm sure I have seen volumes of marketing material that claims 100% uptime, possibly from the owners of Arvixe hah hah hah hic
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If marketing were true we'd all be out of a job because there's all kinds of tools that make writing applications a snap!
|
|
|
|
|
I am very much a newbie, and am trying to teach myself.
I have been following through tutorials on CodeProject.
Invariably, I come across a problem, which I can't solve, so I post a message.
None of these questions get an answer, despite me giving all the details.
The latest is
MVC Study
stebo0728, 2 Jun 2016 CPOL
4.75 (3 votes)
I posted the question:
I get the error:
An error occurred attempting to determine the process id of the DNX process hosting your application.
I should hope I might some sort of reply, but I doubt it.
|
|
|
|
|
That question will be answered by the author of the article when he/she sees your message. Please learn to be patient, everyone here helps in their own time, many have full time jobs, and some even take time off at the weekend.
|
|
|
|
|
There are a couple of reasons: first off it's a weekend, so much of the western world is busy "getting a life" or in many cases "recovering from getting a life last night" and aren't at work. Since everybody answering questions is a "normal" member - just like you - many of them answer questions when at work, not when out enjoying the sunshine!
Secondly, you are trying to talk to one specific person: the author of the article. We know he is still active, because the article was posted recently, but there is a good chance that he uses his work email to sign in (so he gets messages during the working day) and that he won't find out you want to talk to him until next time he's back in the office.
But...can I suggest that you are going about this totally the wrong way?
Member 11740855 wrote: I am very much a newbie, and am trying to teach myself.
I have been following through tutorials on CodeProject.
First off, most of the articles here aren't specifically tutorials: they are a solution to a problem rather than trying to teach you "how to do MVC" - and I would steer well clear of articles which do claim to teach you how to do it!
Secondly, that's a bad approach. The trouble with trying to learn on your own but finding "tutorials" and reading them is that you don't know if there is something you have missed. If you follow a structured course, they explain and introduce all the important bits in a logical order so it's easy to follow and you know that they haven't just skipped the important bits.
Go on a course (best), get a book (second best) and follow it through, do all the exercises. But finding tutorials online and hoping they cover the subject (or even are written by people who know what they are talking about and can actually teach)? Not a good method. It's like trying to learn to drive a car by starting on the motorway / interstate...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: It's like trying to learn to drive a car by
... watching a travelogue of a particular trip someone took.
|
|
|
|
|
That's a good simile!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Did you follow the rules for posting a question?
see here[^]
Many members consider it rude to post a question like "I receive error X when running my application." without any information on what you're trying to achieve or what you did to lookup a solution yourself. (didn't see your post so I don't know if you did or didn't)
|
|
|
|