For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
This is my very first WPf-project, so please have some consideration and don’t advise me on MVVM .
Everything I in my project is working fine except one thing:
Whenever I hit the enter key on my keyboard a button gets the click event.
This button is not default button and the only event registered with this button is the click-event.
This is driving me insane.
If I put a breakpoint in the click event handler the routedEventsArgs e is button base click.
Here is the code related to this problem:
Thank You for Your reply, now it is obvious that the button automatically gets focus, but I could not see difference in appearance of the button. I'll fix that.
How can I prevent any control to get keyboard focus other than with the TAB-key or mouse-click?
It is a disaster when my application gets a reset when the ENTER-key is accidentally hit.
I created a grid based XAML page. In the grid I display images which require no negative top margin, vertical, values. In my page I have two labels in textblocks that will not align properly in their grid stack panel with out using negative top margin values in the textblocks. The first label textblock I have to use a Margin="0,-35,0,0" and the second I have to use Margin="0, -650, 0, 0. The XAML is below. One final thing. After what you see I need a table to display labels in several rows and columns. Each row might have different width columns. In my design what is recommended for that?
I did find an answer to my question by just modifying a couple of properties and adding a new stack panel. As you can see new stackpanels were added using the attribute Orientation="Horizontal. So the grid now works without adding negtive margin values. Now the only thing I'm working on is trying to add a table sub grid as mentioned above. If anyone has any ideas there that would help. Thanks.
After doing a lot of research I found the answer to my problem. See the code below. I now understand a lot more about XAML then I did before. From the code below I now know how to do the upper portion of my page but am lost about how to finish my page.Now my confusion is the bottom part of my page needs to be as set of several vertically tables, two per row, with headers and three columns per table. I think that I need to use grids to do this but still am not sure. If someone could point me in the right direction that would be great.