|
This won't handle the case of somebody using the mouse to paste data or cutting data for that matter. The solutions given previously are what the OP needed in his situation. In the more general scenario that you're preempting, to be successful you need to at least ...
override OnKeyDown
override OnTextChanged
override WndProc and trap WM_PASTE and WM_CUT
... being careful to allow navigation keys like Home, End, Tab, Shift+Tab and the arrow keys if appropriate.
If you just disable all keys the UI becomes very non-standard and the user will hate you and your software!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
|
Thank you DaveyM69 for the tip. Although the solution proposed by
nelsonpaixao is not what I was looking for and my current need is perfectly addressed by making DropdownStyle=DropDwonList, I will keep this solution in mind for some later day, e.g. when I need a textbox that only accepts numbers. Thank you nelsonpaixao.
It's better to know some of the questions than all of the answers.
Pravin.
|
|
|
|
|
.hey friends! can you help me in changing look&feel in C# winforms and please also help me using flash objects, menus, buttons in creating a winform application for standalone pc's any answer or suggestion for this then give it to me. IT IS URGENT! currently i am using vs 2005 and 2008
|
|
|
|
|
WinForms doesn't come with skinnig support (WPF does) but you can use third party libraries such as DotNetSkin[^] or IrisSkin[^]
|
|
|
|
|
Firstly, bold text should be used only to highlight a single point, not an entire post. It is tantamount to shouting, only BOLD CAPITALS are worse. Oops, I notice that as well.
Secondly, what have you tried? Give an example of where you are stuck and help will come. "urgent! send codz plz!" (tm) is not asking for help, it is asking to be chastised.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
i means here not to send whole code but to send some help snipts for look & feel in C# winform applications as you can see in java the look and feel controled by:--
com.plaf.metal.metallookandfeel;
or
com.plaf.motif.motiflookandfeel; etc.
|
|
|
|
|
Hi all,
I have a requirement of exporting image to MS Word, PowerPoint and PDF.
please suggest me how to do that.
Thanks in advance.
cheers,
sekhar
|
|
|
|
|
I have an article about converting image files to PDF. Check my profile. As for the MS formats, there are paid tools. I don't know of any free one.
|
|
|
|
|
Hi I was wondering if anybody knows how to create a MSI project(Setup and Deployment project). I am using Visual studio to do this but can't figure out how to pass parameters entered on screen to my registry. Any help would be appreaciated
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
|
OK lets say I've got a form that sets regestry values. I must add an installer class to that project and then add that project to the custom actions. Is that right?
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Yes that's along the right lines.
Generally your project will output a single assembly (exe / dll). That assembly may have some requirements that need to be created at installation time - in your case, registry entries.
So you build an installer class into each assembly, which handles the requirements for that assembly.
So your installer class in this case, will read the parameters that are passed to it from the msi (which the user typed into the msi gui). It will then use these parameters when creating the registry entries.
The assembly in question needs to be added to the custom actions - this is how the msi knows to look into that assembly and find the installer class and call its methods.
The mapping between the msi gui fields and the CustomActionData property of the custom action in the deployment package designer is something like this:
/MasterClientID=[MASTERCLIENTID] /LoggingPath=[LOGGINGPATH] /LogMsgsPath=[LOGMSGSPATH] /LogDbConnStr=[LOGDBCONNSTR]
The code for retrieving the parameters in the installer is something like this:
public override void Commit(IDictionary savedState)
{
string mstrClientId = Context.Parameters["MasterClientID"];
string loggingPath = Context.Parameters["LoggingPath"];
|
|
|
|
|
Hi,
how can i create crystal report by code, not with the given objects in c#2008, is there a good article?
Thanks
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi,
private void ComboBox_RaceGrandPrix_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar < 256)
e.Handled = true;
}
how can i create a classe/routine for this. I can´t do it without the "e" stuff. i repeat this in other routines to, i want to avoid that.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Have one method, and have each control call it?
|
|
|
|
|
I'm very new to C#. I'm a beginner. I just need a very simple example of a ProgressBar that fills once every second for 10 seconds then goes blank and then fills every second for 10 seconds. I need this to study how it's done for something else. Many thanks if you are to help.
|
|
|
|
|
Listen, you have to start doing that, later on if you get stuck ask here for help ok? you are asking to post all the code, we are not your employees!!!
That is not hard to accomplish, i am sure you can do that!!!
Good Luck
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Put a Timer control on your form and experiment with it. The method in which you write the code is the Tick event handler.
|
|
|
|
|
Hi...
I am trying to draw a line with DrawLine method in a panel when a button is pressed ! But i cant do this outside of panel1_onPain(object sender,PaineEventArgs e) event handler.
I'll be glad if you give me an example.
ThanX !
|
|
|
|
|
you can get the graphics from panel.CreateGraphics() and use that to draw whatever you want.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
You can draw graphics anywhere you like, so you can draw anything on the screen where the panel happens to be. However, when the panel is redrawn for any reason, whatever you have drawn is gone.
Also, if you draw on the screen where the panel is and the panel is partly or fully covered by another window, you will draw on top of that window, not on your panel.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: panel is redrawn for any reason, whatever you have drawn is gone
Hi Guffa, not wanting to hijack the thread, but this is something, I've come across myself recently in a WinMobile signature capture control.
What would you suggest is the best way around that? I stored the drawing in a MemoryStream and used that in the OnPaint but it felt a bit 'hacky'.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
A MemoryStream seems to be an awkward place to save something like that. It means that you have to decode it somehow every time you use it. Whatever you store, there has to be some more convenient way to keep track of it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I create several labels at runtime, and their click event is for all labels the same.
My only problem is how to recognize which label is clicked, because now I only get the label.Text property in the eventargs which is not very usefull.
The answer must be somewhere in this messageboard but I don't know on which term I have to search.
Many thanks in advance
|
|
|
|