|
is it possible?
for example, form1 got a lot of control and whenever showed, the controls load one by one.
this is very ugly.
|
|
|
|
|
Display a splash screen or a progress bar[^] until the form is loading initially.
|
|
|
|
|
put the splash screen on form load?
|
|
|
|
|
|
Hi
I used the GetAsyncKeyState API function
Private Declare Function GetAsyncKeyState Lib "user32"
(ByVal vKey As Integer) As Short
My problem is that I have to know if the key that pressed is the English or other languages to print out the key which is pressed
thank you in advance to helping me out
|
|
|
|
|
A key isn't pressed in any language; a key is merely a key, and a combination of keys produces a character. You cannot map key 'a' to character 'a', because it might be that the user is typing 'A'. Alt-A doesn't even count as a character.
Hence, you'll have to figure out what the character the keys would map[^] to.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Your sig is all wrong in this forum; as the OP posted some VB code (you didn't notice?) he should use a translator the other way around...
|
|
|
|
|
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
thank you so much,
what I want to do is what you mentioned above.
what I mean here is to have a character of the key which is pressed,but in different language(the language that is in the layout)
I have seen this function before but, I ran into lot's of problem(sorry I don't have lot's of experience)first is that by using GetAsyncKeyState I can't access to the virtualkeycode, the next problem is that I don't know which type of mapping should I use to reach to my goal .
Part of my code is written below:
foreach (System.Int32 i in Enum.GetValues(typeof(Keys)))
{
int k=i;
if( (KeyLogger.Methods.GetAsyncKeyState(i)== 1) ||(KeyLogger.Methods.GetAsyncKeyState(i) == Int16.MinValue))
{
keyBuffer += Enum.GetName(typeof(Keys), i) + " ";
}
|
|
|
|
|
a.fatemeh wrote: I have seen this function before but, I ran into lot's of problem(sorry I don't have lot's of experience)
You'll rarely be building the same thing twice, which means that you'll constantly be discovering new things with which you don't have experience.
Here's[^] part of your puzzle, enjoy.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
|
There's five answers in the thread that I linked you. You need the second answer.
Btw; Iḿ using the same tools as you are to come up with an answer
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
yes,it's kind of my answer ,the code has problem which one of them was mentioned below the code is that MapVirtualKey actually returns a uint, not an int.
part of Mycode is as below but it's just show nothing which I couldn't find where the problem is;
const uint MAPVK_VK_TO_VSC_EX = 0x04;
const uint KLF_ACTIVATE = 0x00000001;
textBox2.Text = InputLanguage.CurrentInputLanguage.Culture.EnglishName;
for (int i=0; i<120; i++)
{
if( (KeyLogger.Methods.GetAsyncKeyState(Vkey[1,i])== 1) || (KeyLogger.Methods.GetAsyncKeyState(Vkey[1,i]) == Int16.MinValue))
{
uint temp=KeyLogger.Methods.MapVirtualKeyEx((Convert.ToUInt32(Vkey[1,i])),MAPVK_VK_TO_VSC_EX,KeyLogger.Methods.LoadKeyboardLayout(InputLanguage.CurrentInputLanguage.Culture.KeyboardLayoutId.ToString(),KLF_ACTIVATE));
StringBuilder keyname=new StringBuilder();
int nsize=50;
if (KeyLogger.Methods.GetKeyNameText(Convert.ToInt32(temp),keyname,nsize) !=0)
{
keyBuffer+=keyname.ToString();
}
}
}
if (keyBuffer != string.Empty)
textBox1.Text=keyBuffer;
|
|
|
|
|
I'm developing a Windows phone app with the SQLite SDK. I have reach a point where I want to call a generic within a generic method which the compiler cannot agree to use.
Here is a short version of the code which gives the same compile error as my application for my Windows phone.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Friend[] friends = Foo<Friend>();
}
static T[] Foo<T>()
{
var obj = Bar<T>(); // <--- Compile error
T[] array = obj.ToArray();
return array;
}
// Method from a SDK. Cannot edit this method
static IEnumerable<T> Bar<T>() where T : new()
{
for (int i = 0; i < 10; i++)
{
var obj = new T();
yield return obj;
}
}
}
class Friend
{
public Friend()
{
}
public string name;
}
}
Let me explain the code:
There are two methods here.
My method: Foo<t>()
The SDK's method: Bar<t>()
I cannot change the SDK's method and have to use it as it is.
In Foo<t>() I get the compile error when I try to call the Bar<t>() method.
The compile error is:
"'T' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T' in the generic type or method 'ConsoleApplication1.Program.Bar<t>()'"
If you paste in the code above in a console application, you'll have the same compile error.
Is there any way I can change the Foo<t>() method so it work with the Bar<t>() method and is easy to call in the Main() method?
The SDK method I'm referring to is:
inside the SQLiteClient file in the SQLiteCommand class and is called: "IEnumerable<t> ExecuteQuery<t>()".
You'll need the SQLite SDK for Windows phone to access it.
|
|
|
|
|
It may be that Bar<T>() has a where T : new() so your Foo<T>() requires it as well.
|
|
|
|
|
|
Like PIEBALD says, calling Bar which has a constraint on T, without presenting one itself Foo is not OK. Adding a constraint to Foo will dismiss your first error message. Your code snippet however immediately fails on the next line now, as there is no definition for ToArray().
|
|
|
|
|
I did as PIEBALD suggested and it worked!
Thanks anyway for the information
|
|
|
|
|
Hello,
Projects in the solution are referencing dlls found in:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0
but even though the dlls are there, visual studio does not see them.
Any help is welcome.
|
|
|
|
|
Try doing a clean and then rebuild the solution.
Do ensure that there are no yellow exclamation marks when you look at the list of references in a project. An exclamation mark would indicate a missing dll reference.
|
|
|
|
|
I have a gui application and part of its function is to query active directory and return search results. It writes these results to a textbox line by line.
I would like to double click on a line to select that specific line, load it into a string and then parse data out of that line with code in the background.
How can I handle the double click/line selection event? Thanks!
|
|
|
|
|
There is no "line selection event". There's a click-event, but that does not tell you which line - although you could assume that the line was clicked where the cursor is located on.
If you're reading it line by line, and presenting as such, why not use a listbox?
Bastard Programmer from Hell
|
|
|
|
|
You should use a ListBox, not a TextBox, for anything that is line oriented. It is much faster (it can handle millions of items), and easier to program too. With respect to TextBox, the one thing you have to add yourself, if you need it, is some kind of "Save All to Text File" if you ever need that.
BTW: you can easily apply simple formatting, again line-oriented, as is shown here: http://www.perceler.com/articles1.php?art=asyncpool1[^]
|
|
|
|
|
If I were doing this, I wouldn't use a TextBox . You have effectively turned the TextBox into an editable ListBox , and this really doesn't sound like the effect you are trying to achieve.
So, replace the TextBox with a ListBox , and then simply handle the SelectedValueChanged event.
|
|
|
|
|
Thank you, the listbox worked great and I'm ready to put out a test version of my application.
I just recently started getting this error, do you all have any idea what is causing this? I remember googling it and not coming up with much, hopefully I missed it and this is something easy.
Error 2 An error occurred while signing: Failed to sign bin\Debug\app.publish\\setup.exe. SignTool Error: ISignedCode::Sign returned error: 0x80070057
The parameter is incorrect.
SignTool Error: An error occurred while attempting to sign: bin\Debug\app.publish\\setup.exe
|
|
|
|