|
Hello,
I have a richtextbox richTextBox1, and all I want to do is prevent the tab key from actually inserting a tab in the richTextBox1. instead I am catching when the tab key is pressed, and switching to the next control in my form, which I have been able to successfully do. How do I do this, I have tried using e.handled = true for the keydown and keyup events, to no success.
thanks!
Stephen
|
|
|
|
|
Hi,
First, set the AcceptsTab property of your richtextbox to true to ensure that keydown is raised on the tab key.
Then, you need to set
e.SuppressKeyPress = true
instead of e.handled.
|
|
|
|
|
Dear all,
I have one c# window form which contains datagridview controls,i have made
some columns visibility to fale.I have one button control when i click the
button another form opens and when i will close the second form i need to
show main form datagrid view control columns by seeting visible=true.
This is happing fine but the datagrid view is not refreshing.I tried with
datagridview.refresh() method also.
Please help me on this.
Regards
Veeresh
i want to join this group
|
|
|
|
|
Hello,
I have a listview in largeicon mode. If I press the right arrow when the rightmost item is selected in a row, nothing happens. I would like it to jump to the first item of the next row.
What I tried was cancelling the keydown event for he left and right arrows, and handling the selection manually (and calling ensurevisible()).
The problem with this is that I want to do some processing for the newly selected item.
My method will raise the selectionchanged events for every single item I visited. The default method only raised it when we 'settled' on an item (and sometimes in betwen )
If I keep the down arrow pressed, items will keep getting selected, and the listview will keep scrolling. This is good.
If I keep the right arrow pressed, I will keep processing all of them, which delays EnsureVisible(). This means that the selected item will be off screen for most of the time.
Any ideas?
|
|
|
|
|
Hello, I want to do packet filter program and I've found some articles about packet sniffing but I've a problem. I'm trying to create raw socket but I always get socket exception with error code 10013 (access denied). I''m using Windows Vista and VS 2008 Express.
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Unspecified);
I try to run this code on VS 2005 and it was fine...no exception. So I don't know where the problem is.Anyway, any suggestions how to do packet filter in C# or how to block ports or internet acess(for specified program or for all)? Thanks.
|
|
|
|
|
Member 4680844 wrote: I''m using Windows Vista and VS 2008 Express.
Yeah, RAW packets are off-limits to all user accounts. THe only account that can create RAW packets only under an Administrator account. It's been that way since SP2 came out for Windows XP.
Member 4680844 wrote: I try to run this code on VS 2005 and it was fine...no exception.
Speaking of XP, was this code under 2005 perhaps running under Windows XP or XP SP1?? Under XP and XP SP1, normal user accounts could create RAW packets without any issues. The same code, running under the same account, will not work under XP SP2 and above.
|
|
|
|
|
Thanks for reply! But from you reply I understand that I can't create RAW socket under regular user account. But this is exactly what I need, because I've a laptop and I don't care about administrators, but when someone other uses the computer(logged as guest or some other user without administration rights) I want to block some internet pages or ports. I know that I can use some programs or firewalls but I want to do it by myself. And about the raw socket, I run the code on same machine(Vista SP1) but once compiled with VS 2008 and then with VS 2005 so I'm really confused about this issue. Anyway any ideas how to do packet filter? Thanks!
|
|
|
|
|
Member 4680844 wrote: I understand that I can't create RAW socket under regular user account. But this is exactly what I need
It's not going to happen if you run it under Windows. It's that simple. You need to run the code under a full admin account, or it's not going to work.
In order to get VS 2005 to work under Vista, you had to run it as an admin, otherwise it doesn't work very good.
|
|
|
|
|
Thanks for information! So I tried to do a service for this issue (using system account) and I'm able to read incoming packets. I'm able to get IP address from them and here comes the second issue. How to block/restrict/drop packets from specified IP? Is it possible to do it in C# or I must use C++ and how to accomplish it? Thanks.
|
|
|
|
|
Well, I hate to tell you this, but you're not intercepting anything. You're standing off to the side of the packet stream, watching them fly by.
You can't do what you want without writing a packet driver to stick into the network stack, which you can't do in C#. Well ... not nicely or efficiently anyway.
If you want to see what it takes to do this, look at these[^] open source firewall projects.
|
|
|
|
|
I can Enable/Disable Serial Port through device manager. But I have to
do it through programming . How can i do that in C#?
Thanks in advance
Moustafa..
|
|
|
|
|
Hi All,
A quick question regarding mapping? I supply a free app to our customers for downloading GPS data from a handheld. What i have is an array of long/lat positions. What i would like to do is plot that information inside the Windows application... I've had a look at Google Maps / Live Maps API and altho they look good, they look like their supposed to be used on a website... not a winform app?
My question to you guys is what would be the propper / ideal technology to use to acheive this?
Many many thanks!
Will
|
|
|
|
|
|
mmmmm thats a tad expensive!!
is there any free alternative??
|
|
|
|
|
|
Who can do mouse gesture?
I need to create source code same program "Stroke It" with C#
Please help me...
Please create source code or advice to me...
Thank a lot for everybody.
|
|
|
|
|
Please don't post the same question twice. You already received reply here: how to mouse gesture without window[^]
Also, don;t expect anyone to write code for you. We can give you hints but we are not going to do your job.
|
|
|
|
|
hi all
i want to seacrh in a text like "hello code project"
and i want to know how many time the letter 'e' for example comes in this text
and i want to know how many time the letter 'e' for example comes in the first in the word , last in the word, middle in the word
is there a way to do that
please help me
thanks for all
Kareem Elhosseny
|
|
|
|
|
You could simply iterate the string. You can use IndexOf method to search for desired characters and Split method to break the sentence into words.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
plz my friend can u write for me the simple code
here is my code and it works but i dont know how can i know the letter in first or in middle or in last
thanks for ur help my friend
string convertedPw;
int counter = 0;
int uLetters = 0;
//string quran = "Allah Akber";
//CharEnumerator charenum = quran.GetEnumerator();
string mytext= "hi code project";
CharEnumerator charEnum = mytext.GetEnumerator();
while (charEnum.MoveNext())
{
convertedPw = Convert.ToString(pw[counter]);
// here i use the unicode tro define the letter
if (convertedPw == "\u0645")
{
uLetters++;
}
counter++;
}
lblDetails.Text += "ur entry letter comes: " + uLetters.ToString() + "\n";
Kareem Elhosseny
|
|
|
|
|
You could try investigating something like this:
string mytext = "hello code project";
string[] words = mytext.Split(' ');
int wordcount = words.Length;
int numberOfInterestingCharacters;
foreach (string word in words) {
numberOfInterestingCharacters = word.Split('e').Length - 1;
}
The need to optimize rises from a bad design.
My articles[ ^]
modified on Saturday, November 22, 2008 1:10 PM
|
|
|
|
|
thanks my dear friend i'll try it
Kareem Elhosseny
|
|
|
|
|
There are three 'e' characters
There is one 'e' in each word.
I really don't see the need to write software to do the counting in that situation. If you did it with .Net 3.5, you'd need to ship your 30k program and the 305mb runtime installer. Let's talk about overkill.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm sorry that someone did your homework for you. I suggest you spend some time REALLY understanding the code you were given, so you're capable of building on it with the next assignment.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: I'm sorry that someone did your homework for you
That would be me. Based on his profile I didn't consider this as a homework assignment, but you could be right Oh well, still lots of things to learn...
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|