|
Hi!
I'm trying to do a virtual keyboard for my application.
I want it to be localizable but I have a major problem: how can I emulate a key stroke with SendKeys for the so called dead keys? I tryied for example with:
SendKeys.Send("{^}e"); //(for the french ê)
but it doesn't seem to work. Am I doing something wrong? Is it even possible to do?
Thanks to anyone who'll reply.
Loveday
|
|
|
|
|
Is the keyboard switched to the French culture keyboard?
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
theRealCondor wrote:
Is the keyboard switched to the French culture keyboard?
Yes, it is...
|
|
|
|
|
I believe that you can't. What you probably will need to do is reproduce the dead keys behavior, i.e., when you detect a dead key press, you wait until the next key press to really execute the action, e.g., SendKeys.Send("ê").
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
Thank you...I suspected so. The problem now is that there isn't any real keyboard.
Bye
|
|
|
|
|
Ok,Maybe the subject heading is a little confusing.
I am having a problem with items in a listbox that were put there using drag-and-drop from a treeview. Now, if I add the items to the listbox any other way, I do not have the problem. I have a search function that searches through a treeview for the selecteditems of the listbox. It works fine, unless you drag and drop the item in the listbox. Any suggestions? Thanks.
PD
|
|
|
|
|
Based on the small amount of information you have provided I can rather quickly guess what the problem may be.
It sounds like you have an initialized listbox. What object type are you initializing it with? Are you populating it with TreeNode or ListViewItem or String? If you drop a TreeNode onto the listbox, it may accept the Treenode object instead of the TreeNode.ToString(). Then when you loop through the table you have mixed object types in your list. If you are casting the Item to a specific type, you'll get an exception if you are doing
a = (myObject)item;
and you will get null if you do
a= item as myObject;
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
I am populating the listbox with string. This what I have:
private void treeView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
//if(treeView1.SelectedNode.Nodes)
if(e.Button == MouseButtons.Right)
contextMenuParent.Show(this,new Point(e.X,e.Y));
treeView1.SelectedNode = treeView1.GetNodeAt (e.X ,e.Y );
}
private void listBox1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
{
string str = "";
// Get the string from the data that was dragged
string s = (string)e.Data.GetData(str.GetType());
s = s.Substring(s.IndexOf(":")+ 1).Trim();
// Drop the string in the listbox
listBox1.Items.Add(s);
//textBox2.Text = s;
treeView1.SelectedNode.ForeColor = Color.Red;
Position.X = e.X;
Position.Y = e.Y;
Position = listBox1.PointToClient(Position);
}
Then I have a search function that takes the selecteditem's text from the listbox and looks for the text in the listview and makes the necessary changes.
If I add it like this:
listBox1.Items.Add(treeView1.SelectedNode.Text);
It works fine.
Thanks again for all of your help.
PD
|
|
|
|
|
Hey, thanks RealCondor. The problem lied within my search function. I had it searching for "text" rather than "anything" ToString(). You were a big help.
PD
|
|
|
|
|
Hi,
I have a program which will accept two user inputs (databse admin username and password) during installation. I want to do some very basic verification on the inputs(make sure the two textboxes have been filled with some text) before the next installation step.
I created a Setup project and added a custom dialog box (a textbox just after the Welcome dialog) but I don't see there's any way to do the simple checking on the textboxes. Is it possible to do the verifications at this stage of installation? and if yes, how can you do it?
|
|
|
|
|
Try this
http://www.c-harpcorner.com/Code/2003/Dec/CustomInstallMG.asp
Alomgir Miah
Live Life Kinh Size
|
|
|
|
|
can you run an if inside of a while statement?
while (dataReader.Read())
{
if (dataReader["password"].ToString() !=null)
{
if (dataReader["password"].ToString().Equals("board"))
{
InitializeComponent();
Connection();
dataReader.Close();
}
else MessageBox.Show("Sorry, unable to verify ");
}
else MessageBox.Show("Sorry, We are unable to verify")
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
Yes you can! But I certainly would never put InitializeComponent(); inside an if statement!!!
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
theRealCondor wrote:
Yes you can!
k, so any ideas why it isn't verifing the if statements? are they correct or am i missing somthing....besides the intiallizecomponet part.
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
Did your datareader actually return anything? You can't know for sure because your code doesn't check for it.
What I mean is, if datareader.Read returns false on the first call you make, the code in your while block will never execute.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
OH, good one, your right didn't check for htat one
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
Well there is either a problem with your If or there is a problem with your datareader object and how you are getting the data. A minor change I would suggest is this:
while (dataReader.Read())
{
if (dataReader["password"] !=null)
{
if (dataReader["password"].ToString() =="board")
{
InitializeComponent();
Connection();
dataReader.Close();
}
else
MessageBox.Show("Sorry, unable to verify ");
}
else
MessageBox.Show("Sorry, We are unable to verify");
}
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
I need to do testing of two different implementations of logic and how they impact memory.
Is there anyway within my program that I can call a system method to find out how much memory I am consuming? It would be great if I could get this and display it realtime instead of running utilities outside the process.
Thanks.
|
|
|
|
|
There is no one function to call to find this out. Since the .NET Framework reserves a chunk of memory for your application, using the normal non-.NET methods (like Task Manager) of memory size won't work.
In order to get the real numbers, you'll have to query the .NET CLR Memory performance counters. These are the very same counters you'll find in the Administrative Tools/Performance Monitor tool.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
C# - We are using a large, common set of images for buttons in our application, across a large number of forms - this is a very large app. I'm exploring using a dll with 1) an imagelist which can be accessed by any screen needing it, or else 2) embedded .gif resources that are then accessed via a static method in that dll.
Either way, it would be nice to be able to add something to the Visual Studio ToolBox so that when developers design their screens, they can assign images to controls and actually see them in the designer.
Can anyone point me in the right direction for info on accomplishing this?
Thanks
Rich
ps - remove the x from the email address if you wish to contact me directly.
|
|
|
|
|
Without giving it too much thought ...
one approach you could take is to place your images in an imagelist that is held in a static class. The forms just need reference to the DLL and they can call a static method that you would have to write :
Image GetImage(int imageNumber);
GetImage() would return the image in the imagelist at the specified location. The apps would have to set their icons at initialization time for buttons, etc.
That would have to be a very-well protected DLL though since changing the image locations would screw the entire application.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
Thanks for the reply. If I do use a statically created ImageList, would I be able to access it from the toolbox in design mode, so that the other programmers could use that imagelist in their individual forms?
|
|
|
|
|
That's the downside to the design. To have something at design time, you need to have every form have the imagelist within themselves. This makes a maintanance issue for large projects like yours.
By keeping a atatic list accessed with a static method, you centralize support, but eliminate the convenience of design time deployment. That is why I said you would need a standard that developers initialize their images at constructor time. But you could take the list of images, create a graphic cheat sheet in Paint with their numbers in the imagelist and distribute that. Then when they create the constructor code they can visually see the graphics so they know they are mapping the correct image to the control by the method call.
On the bright side: after one or two forms are built, the developers can get accustomed to this way of setting graphics rather quickly.
If your forms have some standard graphics/buttons on all forms, you could also establish the graphics and image initialization and use that as an inherited form. That reduces the amount of development for the image management and increases standardization.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
I have ListView control in Details view, and i want to show an icon to each item in the first column. Is it possible in this details view of the control?
thanks.
|
|
|
|
|
Set the imageindex of the listview first. Keep the listviewItem.SubItems[0].Text = "".
Then do something similar to following.
foreach ( ListViewItem item in this.Items )
{
if ( ((EntityBase)item.Tag).ValueList["CloseDate"].ToString().Trim() == String.Empty )
{
item.ImageIndex = OPEN_INDEX;
}
else
{
item.ImageIndex = CLOSE_INDEX;
}
}
Alomgir Miah
Live Life King Size
|
|
|
|