|
I have a page of text painted on a tabpage panel. But I cannot highlight the text on it. How can I do it?
Thanks
|
|
|
|
|
I assume, from your question, that you are doing the following:
1) override void OnPaint()
2) doing a graphic.DrawString()
You will not be able to select text in that situation. The only way you can have selectable text is to replace the owner-paint function with populating a control that is meant for text selection....like, oh say textbox???!!!!!
|
|
|
|
|
I am developing Login Control where the user can enter username and password. in the Username and password box i should restrict the user from entering Special Chars, and other invalid keys.
i know i can compare the the value in Keydown event using Keys.Keycode, but it is very ugly to put all the Spl char comparision like if(e.Keycode==Keys.Enter || etc..). Is there any function or way to Compare the key pressed is a spl. char or not.
Thanks and Regards
Srini
|
|
|
|
|
Try MaskedTextBox!
But filtering using KeyDown is still my preference.
-K
Jup
|
|
|
|
|
Think outside the box!!!!!
You have a group of keys that you want to have disallowed from entry in a textbox. So a simple solution to this would be something like this:
List<Key> invalidKeys = new List<Key>();
...
private void ThisForm_Load()
{
invalidKeys.Add(Keys.Enter);
invalidKeys.Add(Keys.Ctl);
...
}
...
if ( invalidKeys.Contains(e.Keycode) )
e.Handled = true;
-- modified at 9:49 Thursday 13th July, 2006
|
|
|
|
|
"frmAdmin" is a value of a string variable.
There is a Form class in that name too.
i get this string value during run time.
how can i instantiate a form of which the class name is the string value ?
supun
-- modified at 0:59 Thursday 13th July, 2006
|
|
|
|
|
Use Activator.CreateInstance() method:
Type formType = Type.GetType("MyNamespace.frmAdmin");
frmAdmin form = (frmAdmin)Activator.CreateInstance(formType);
form.Show();
This will work if frmAdmin is defined in the same assembly. Otherwise use CreateInstance() with other parameters.
|
|
|
|
|
Thank you very much Andrew.
Supun
|
|
|
|
|
Hi all,
I have set an image to the Background of the form,
Now the image consists of a circle in blue color and the rest area is
black in color and i want this part to be transparent so that the form
looks Circular in shape.
I have gone thru http://www.codeproject.com/csharp/customforms.asp[^]
to do the above part.
But this link specifies that the VGA should be set to 1 bit,
I tried that and the form looked circular but the blue circle had some rough border,
i want the image to have a soft look and also that should work on 32 bit VGA
Thanks & Regards,
Pramod
|
|
|
|
|
Read this article.
Best regards, Alexey.
|
|
|
|
|
I want to create CHM Help file programmatically in C#. Basically I want to create documentation for my tables and stored procedures.
I did lot of searching on net but what I found is "HTML to CHM".
So What I think is,
1) I will create html files programmatically
2) Using some complier or some batch command or some thing, I will create CHM files
But some article points that you can use CHM file as a help in your .NET Application & some where it is written that System.Windows.Forms.Help can be used for it so there must be some way.
Can anyone give me some idea or some right direction?
Just I need fire, Then I will do it.
Nilesh Gambhava,
Life is NP-Complete so don't use Algorithm but use Heuristics
|
|
|
|
|
Hi,
To use .chm-file in your application as help file you can use HelpProvider class.
appHelp = new HelpProvider();
appHelp.HelpNamespace = "MyApplication.chm";
And then use SetHelpNavigator(), SetHelpKeyword(), SetHelpString() and other methods.
|
|
|
|
|
Thanks for quick response.
But I am not getting it.
I want to create new CHM file, I dont want to use CHM file as help
Nilesh
Nilesh Gambhava,
Life is NP-Complete so don't use Algorithm but use Heuristics
|
|
|
|
|
Like a 'critical system process'
What i really need is to stop people form closing a security app through the command line. So if theres any way to do that then, yeah.
|
|
|
|
|
try building a windows service that and set the stop property to false.
Do your best to be the best
|
|
|
|
|
Try API hooking.
Hook the TerminateProcess API.
You can use the madshi library.
www.madshi.net
Eran Aharonovich (eran.aharonovich@gmail.com )
Noviway
|
|
|
|
|
Hello,
I have a listView with the View property set to List. What I want to do is simply preventing the listView item from showing on serveral columns.
Like this:
1............2.............3
4............5.............6
I want them to appear as follow:
1
2
3
4
5
6
Please note: I don't want to add columns that will be visible to my user.
Please help. Thanks.
|
|
|
|
|
Hi,
No, you can't do this with the "List" View style. But you can set View = Details, add one column and set HeaderStyle = None if you don't want your users to see column header.
|
|
|
|
|
I can get the username, which will work most of the time, but as for example on my computer, the address is
C:\Documents and Settings\USER.OWNER-VS1SHD0MH8\My Documents\
because my computer is wierd.
But i need to know how to get to 'My Documents' every time.
|
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
Hope that helps
|
|
|
|
|
Oh yeah, thats good.
You learn somehting new every day. Its a miracle i didn't find this sooner, just think of the minutes i could have saved typing!!
|
|
|
|
|
i am building a software that will read from a csv file that is constantly been lock by an avaya smdr that keeps on writing to that file, but i want my program to be able to jus open the file and read it is this possible?? or once another program has lock a file for readAndWrite i cant even read from that file
kenny
|
|
|
|
|
|
thanks for the link i jus getting ready to leave the office but as soon as i reach home i going read it.
kenny
|
|
|
|
|
i reading through the example u sent me and i saw how it would allow you to read write to a integer value name resource but how would i use this in terms of reading from a text file
kenny
|
|
|
|