|
I've done quite a bit of work in this area dating way back to the .NET 1.0 beta days.
As far as hot keys, understand that only dialogs process characters and may or may not pass those messages to child controls, such as your UserControl . In the case of IE, it most likely won't because a site could hijack your settings (the web is a very dangerous place to visit, probably even more hostile than Iraq right now!). That would be my educated guess.
As far as visual styles, calling Application.EnableVisualStyles() must be done in an application - not your control. What this does is load a general manifest from the .NET Framework directory (ex: %WINDIR%\Microsoft.NET\Framework\v1.1.4322) BEFORE controls are created, which encapsulate the Windows Common Controls. Once those are loaded into an address space for a process and used by a particular module, that module cannot use two different versions (but the process can, IIRC).
You need to instead embed a manifest in your PE/COFF executable (not the assembly itself, rather, the manifest of resources) using a particular ID.
For starters, read my article Windows XP Visual Styles for Windows Forms[^], which describes the "old" way (still supported) of embedding manifests as Win32 resources. You'll also want to read Visual Styles[^] on MSDN.
Another article you may find interesting about making your embedded UserControl scriptable (as well as exposing events), take a look at a very old article of mine on a different site, User Controls for Winodws and the Web[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hello,
I Hope someone can help me with my problem.
I Do the following:
- Create application
- Put combobox on main-form
- Add values in combo-box collections
When I run the application the items in de combobox are not visible. When I click on an invisible item, the value appears in the combobox, so the items are present.
When I copy the application to any other pc and run it, it all works fine, there is no problem.
When I build the application on the other pc and run it on mine, it all works fine too.
My colors are correct (background and textcolor are definitly not the same color).
Help!!!
|
|
|
|
|
hi,
Check the forcolor of your combobox and make sure that the color is not Transparent.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Thanks for your answer.
I checked de forecolor. Its value is WindowText (In my case black)
|
|
|
|
|
hi,
Did you installed any theams on your machine.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
|
hi,
I am really sorry.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I had the same problem and was caused by McAfee VirusScan Enterprise 8.0i's Buffer overflow protection.
I tried to disable it and my comboboxes start working well again.
If someone has the same problem read the document in
this location
|
|
|
|
|
simply, i want to make a c# program that counts words in a sentence entered by the user. i know a method to count no. of characters in a certain sentence, but what about words, what's the idea ?! i'd appreciate it if anyone could help here.
|
|
|
|
|
<br />
string[] words = sentence.Split(' ');<br />
int count = words.Length;<br />
?
|
|
|
|
|
thnx a lot man. but am sorry i got another question, this two lines of code counts the number of words only in case they got only one space character between each two words, what about if i got a sentence like this
"hello world" with 5 space characters for example and not "hello world" with one space character.
the program won't count the first sentence as two words i think.
|
|
|
|
|
Check for the length of each instance in the array If it has 1 character or more it is a word.
Try something like the following
string[] words = sentence.Split(' ');<br />
count = 0;<br />
<br />
for (int x = 0; x < words.Length; x++)<br />
{<br />
if (words[x].Length > 0)<br />
count++;<br />
}
Kev
|
|
|
|
|
|
int count = Regex.Replace("Hello World", @"\s+", " ").Trim(' ').Split(' ').Length;
That should work fine.. You can also have spaces at the front and the end of the string and it will still work.
e.g.
string testString = " This is my Dog ";
int count = Regex.Replace(testString, @"\s+", " ").Trim(' ').Split(' ').Length;
Regards,
Brian Dela
http://www.briandela.com IE 6 required. http://www.briandela.com/pictures Now with a pictures section http://www.briandela.com/rss/newsrss.xml RSS Feed
|
|
|
|
|
Well, i made a Minesweeper.
The Cells, are a class inherit from Label.
To display the images, i set the BackgroundImage.
But on the Expert mode ( 50x50 ) the game is extremely heavy and laggy
What can i do? Draw with DX? oO
Using components, doesnt work, its very heavy :\
Thanks.
|
|
|
|
|
I've already answered your previous question: do not use controls (as you said, they're too heavy), but manage the drawing surface yourself. See my previous reply for more details.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Override the OnPaint method of your main control and use gdi to draw your playing field.
|
|
|
|
|
hello everybody
please help me in a problem. i want to increase the size of the title of my application is it possible if yes then please help me how?
thanx
|
|
|
|
|
You can either do this through the Display control panel (under the Appearance tab) for all Windows applications, or you'll have to go through the tedious work (experience with Win32 programming is definitely helpful) of handling WM_NCPAINT to paint the Window non-client area (the Window frame) yourself. It's not easy.
You should really consider why you need this, though. There is a user interface guideline for Windows applications to present a common look and feel for a reason: usability. If all your application looked different, users would have problems using them. That's why user interface guidelines exist. Violating this without just cause would just lead to many problems.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
yes i want to change my GUI custom as i like. i dont want to change for my whole system but only for my application as well as i dont want to Paint over menus. because if i use NC_PAINT to increase my title bar it will paint over the menus.
i want a solution that just increase my title bar's size
thanx
|
|
|
|
|
Sorry, but those are really your only two choices. If you want to customize the frame then you're responsible for drawing the frame in its entirety. Only when you draw ontop the frame can you get away with not drawing the whole non-client area.
You don't, however, have to draw every ornament. Just be sure to pass the notification message (WM_NCPAINT ) back - modified or not - to the default window procedure (call base.WndProc inside your override). To chance the size of a frame is a major change, though.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi all,
I have two questions on programming MS Outlook where I want
to get and send email from the MS Outlook.
1. What are the differences between programming the Outlook Com object by
C# and by programming the MAPI ?
2. Are there any difference in programming the MS Outlook and Outlook Express?
Thanks
Patrick
|
|
|
|
|
1. The Outlook OM is specific to Outlook. MAPI is the Mail Application Programming Interface and is implemented by MAPI clients that may or may not contain all the functionality of Outlook (like Calendar, Tasks, etc.), since it is, after all, the Mail API.
2. It's an entirely different code base. OE only does mail while MS Outlook doesn't do newsgroups (NNTP). The object model is completely different, and OE really isn't that extensible. It's meant to be a lightweight mail client (currently supporting POP3, IMAP, and HTTPMail), while Outlook is more of a solution and can support POP3, IMAP, HTTPMail, Exchange, and provides for pluggable protocols. Besides both being mail clients and sharing a common name, they really have nothing in common.
For specifics, you should use OE or another NNTP client and search for relevent newsgroups on news://msnews.microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi Heath,
Thx for ur reply.
I need to programming both on Outlook and outlook express.
For outlook, there is no problem. But for outlook express, it
seems that i need to use c++ to program the MAPI to get the email
in the folders of the outlook express. Is there any C# way to program
outlook express ?
Thanks
Patrick
|
|
|
|
|
You should really use MAPI for both Outlook and OE. Why develop two different codebases to do the same thing when you don't have to? It also poses an installation and maintanence hastle.
The problem is, there's two types of MAPI. The first is the original and exposes an automation interface (which means it's scriptable). Because it's scriptable, it was used by email worms. So Microsoft developed Extended MAPI which has no automation interface and requires that you use native bindings a la C++.
With .NET and C# you can actually use both. You can use MAPI but Outlook will warn when trying to access folders. You might have seen this before. Starting with Outook XP, IIRC, it prompts to allow access for a set number of minutes (or only for the current call).
Using Extended MAPI requires that you P/Invoke native functions.
You can find articles about doing both here on CodeProject as well as MSDN[^]. Just do a search.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|