|
Hi,
I was using the return character to evaluate the input of a textbox via the keypress event.
private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
{
e.Handled = true;
}
}
After turning on autocomple the keypress event is no longer triggered when the pressed key is the return key. Does anyone know a way around this?
Thanks
Karl
|
|
|
|
|
when you use autocomplete and choose a text from the autocomplete list, its sure that it wll not trigger the keypress event because you are not pressing keys onthe keyboard.
try validating the text in the textbox again before you will use it.
Signature has been encrypted
|
|
|
|
|
Thanks for your reply.
It doesn't matter if the text is chosen from the autocomplete list or the person is typing in something completely new. The return key never fires a keypress event anymore. Every other key fires the event. The return key instead causes the text to be highlighted.
I am not sure what you mean by validating the text in the textbox before using it. I currently do not validate the text, anything can be entered in the box.
Thanks.
Karl
|
|
|
|
|
After further investigation it turns out that auto complete only intercepts the keypress event for the return key. The keypress event gets fired appropriately with any other key. The other keyboard events such as keyup and keydown are unaffected by this issue so they can be used as a work around.
If anyone knows more about this issue please reply.
Karl
|
|
|
|
|
from a winform gui control a button or a event should run a command on the cmd.exe in the backend and how to capture the output of it in a string and desplay in a textbox
similarly if i have to issue/get multiple command and its correspondig output in hashtable,
eg, cmd1 its output
cmd2 output
cmd3 output
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Process.StandardOutput Property [^]
Take a look at the example.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
Hi. I want to develope a software like windows or antiviruses.
It means i want to fix my programs problems or update some parts of it without recompiling it or installing it again.
For more information "like stored procedure programming" that doesn't need
any program recomipling I want to change my softwares updates
in customer's computer without installing new version of my softweare and
just install or copy it's service pack!
Shall i create dll base forms and is it possible?
Which reference can help me about this?
Tank you
|
|
|
|
|
freshonlineMax wrote: It means i want to fix my programs problems or update some parts of it without recompiling it or installing it again.
you always need to recompile the code you've changed. You can distribute some code in dlls which the main program can use, and thus not have to update the main program. You can also use ClickOnce to write an installer that updates the program automatically when a new version is available.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Content;
The type or namespace name 'Xna' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
I found this Xna/DirectX example in the Visual C# 2005 Express Edition help files.
But when I tried to compile it I got the error listed above.
I looked for this error and read somewhere that it was a bug. Which hadn't been fixed yet.
Is this true? And what do I do now if I want this program to run?
Ranger.
Novice
|
|
|
|
|
Ranger49 wrote:
I looked for this error and read somewhere that it was a bug. Which hadn't been fixed yet.
Impossible.
It looks to me like the error message is right, you need to have the Xna framework downloaded and installed, and you need a reference to it in your project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: Xna framework downloaded and installed,
I downloaded Xna Game Studio Express and if I understand it correctly that you then no longer need to install the Xna Framework because it was already installed with Game Studio?
I find this really interesting, but I think I will need to buy me a book about it.
Only a few days ago I figured that DirectX would be interesting to program and now I am already contemplating programming Xna class routines!!!
Anybody have any advice for me?
Ranger.
Novice
|
|
|
|
|
Ranger49 wrote: and if I understand it correctly that you then no longer need to install the Xna Framework because it was already installed with Game Studio?
Probably. You still need to add a reference to your project, tho.
Ranger49 wrote: Only a few days ago I figured that DirectX would be interesting to program and now I am already contemplating programming Xna class routines!!!
My core advice would be: a tutorial will have you entering code that works pretty quickly. Make sure you have a grounding in C# in general before getting in too deep, and make sure you take the time to understand what everything you work on does, before moving on to something else. Otherwise, you're not really learning.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: a tutorial will have you entering code that works pretty quickly
I already found one or two tutorials, on the Internet.
Christian Graus wrote: Make sure you have a grounding in C# in general before getting in too deep
I have very little programming experience, and some aspects of C# I don't grasp yet. But it is nice to learn by doing.
I was thinking I saw this SpaceGame starterkit, that would be helpful for someone's learning process, don't you think?
Ranger.
Novice
|
|
|
|
|
Ranger49 wrote: But it is nice to learn by doing.
Absolutely. But, to really learn, you should start by doing programs like a console based calculator, and then build from there. otherwise, you will not really have a solid foundation, and you will likely establish bad habits that will be hard to break.
Ranger49 wrote: I was thinking I saw this SpaceGame starterkit, that would be helpful for someone's learning process, don't you think?
If the only way to keep you motivated is to start with a game, then if there are games tutorials, they are probably the best place to start. And, if you're just doing this for fun, it really doesn't matter if you end up writing production quality code, so long as you have fun.
Good luck, either way.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: doing programs like a console based calculator
I was interested in LEX and YACC and found a few newer compiler compilers. The examples that came with CoCo featured a calculator...
Christian Graus wrote: If the only way to keep you motivated is to start with a game
I was looking for a way to see if I could let DirectX do the rendering and shading on my 3D drawing project for me, instead of programming this myself by hand. That was about a week ago, only yesterday I discovered Xna because I wanted to know if my 3D function could be fed to my graphics card. So that DirectX would draw my graphics for me.
I do realize that I know very little about C#. Even though I find the books I bought about it very helpful.
As it is I have already done things with C# I hadn't even tried in university in the 1980s.
I make everything public because I make small projects and that I don't want to be frustrated by a bug because I labelled something private. Still if I were more advanced I would use private and public where it would be most appropriate.
Thanks everybody for your comments.
Ranger.
Novice
|
|
|
|
|
There is a difference between a using directive and an assembly reference.
Do you understand both, and did you include both?
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
joon vh. wrote: There is a difference between a using directive and an assembly reference
I don't know the difference, I read about both these terms in my book that I bought about C#. But I didn't think I needed to understand the details about it. Just like how I stay away from using get and set commands. In some 6 months since I installed Visual C# 2005 Express Edition on my PC I produced only a few projects and that I am amazed of the things that this SDK lets me do. So I am pleased about the progress I am making but that I realize I have yet a long way to go in the quest to master C# and .NET
Ranger.
Novice
|
|
|
|
|
Ranger49 wrote: Just like how I stay away from using get and set commands.
This is an example of a basic best practice that you're likely to skip if you don't start with the basics. You should always have private members and public properties, and they should only be settable if absolutely necessary. The more a class hides it's members, the more robust it can be.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Spoken like a true master.
I think MVP stands for Master Von Programming. It's a german title or something.
(ps, I'm not a retard, note the joke icon)
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
There are very few C# 'masters' if you ask me. If everyone who started c# would master it eventually, this site wouldn't be as popular.
Anyway, you don't need to understand errrrrrrrrrrrvrything.
This is important though, to start using any SDK.
1. An assembly reference is telling your project that you're using a certain SDK, or another resource. You can do this by rightclicking your project in solution explorer, and choose Add Reference...
2. You should first check your project if it already has the assemblies referenced. Open your project in solution explorer and open the references folder. If it already has, then that's good. If it has an exclamation mark next to it, or isn't there, that's bad. Remove it (if possible) and continue.
3. Open the Add Reference window. Take a look around, and I think you should eventually find the XNA Dll's that you need. Don't know where as I'm not really familiar with the package. This might be noted in
4. Now, in every code file where you use any XNA related stuff, you need to tell Visual Studio that this is what you're trying to do. This is done by a using directive. You say [I Will be] using Microsoft.XNA.Framework;
5. Now there shouldn't be any more errors on missing assemblies.
Hope this helps at all.
In short:
An assembly reference, is telling the project (not the solution) you're using a certain assembly (can be an SDK, or another type of resource)
A using directive is telling a certain code file that you will be using a certain assembly, that is referenced. You can't use a using directive for an unreferenced assembly.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Hello, dear friends !!!
I need to make a ArrayList of Structures.
How can i do it ?
One nation - underground
|
|
|
|
|
Well, create the ArrrayList and then add instances of the structure.
By the way, if you're using framework > 1.1 I suggest using the generic List type instead of ArrayList .
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
C# 1.0 and C#1.1 are SO nasty here. In the absence of typed collections, I would write a wrapper class that allows me to pass my struct into a typesafe container.
Perhaps if you made clear your C# version and posted some code to explain where you have an issue, we can help further ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am using .net framework 2.0, visual studio 2005.
I want to make serialization of ArrayList structures books
struct strBooks
{
public string Author;
public string Name;
public int Year;
public int Pages;
public string ID_for_catalog;
}
I thought about what you had said. Would it be better to use array instead of ArrayList.
Like >> strbooks[] Book = new strbooks();
One nation - underground
|
|
|
|