|
You don't need DirectX or DirectInput for this. Just write a Global Keyboard Hook. Search the articles for "keybook hook", or Google for "VB.NET Global Keyboard Hook" and you'll find lots of resources.
|
|
|
|
|
You can find the keyboard's guid on here:
Microsoft.DirectX.DirectInput.SystemGuid.Keyboard
In other words, you should create your dxkeyboard object like the following example:
Protected mKeyboard As Microsoft.DirectX.DirectInput.Device = Nothing
mKeyboard = New Microsoft.DirectX.DirectInput.Device(Microsoft.DirectX.DirectInput.SystemGuid.Keyboard)
Sincerilly yours. Manusoftar®
|
|
|
|
|
I have developed a software in .Net framework 2.0.
When I install it and then try to uninstall it, it shows the following error message:
Could not open key:HKEY_Local_MAchine\Software\Microsoft\Protected Storage System Provider\*Local Machine*.Verify that you have sufficient access to that key,or contact your support personnel.
I am using my administrative account and it is showing the same error.
What to do?
X
|
|
|
|
|
Not sure and it doesn't sound good.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi, would you please explain the Encoding.UTF8.GetBytes("abc") part of the following line:
Dim b As Byte() = Encoding.UTF8.GetBytes("abc")
I've read about what UTF8 is but I'm not real sure on how to use it. Also I don't know whether "abc" is the name of a datafield or a function. Please elaborate, thank you in advance for your help.
|
|
|
|
|
The GetBytes method will return a byte array containing the UTF8 representation
of whatever string is given to it.
I trust "abc" is just a silly example here.
Read the documentation for more.
|
|
|
|
|
"abc" is a literal string, concisting of the three characters 'a', 'b' and 'c'.
Encoding.UTF8 is a static property in the Encoding class that returns an Encoding object for the utf-8 encoding.
The GetBytes method encodes a string into an array of bytes. Each character in the string is encoded into one or more bytes in the array.
The three characters in this specific string are each encoded into a single byte, so in this case the array will contain three bytes.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thank you. You took the words out of my mouth, errr, off my keyboard
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Suppose I have a file called MyDocumument that is stored as a blob in a database. So if I want to put it in an array of bytes so it can be displayed, I probably can not simply pass the name of the file in like this Encoding.UTF8.GetBytes("MyDocument") . How would I then put this in an array of byte, and do I even need to encode the file inorder to display it? Please explain, thanks for your time.
-- modified at 18:55 Saturday 28th July, 2007
|
|
|
|
|
How are you displaying the information? Unless you are writing the output as a binary stream, you don't have to encode the data. Most ways of output takes strings, and does the encoding automatically according to a previously selected encoding.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi all,
i am using showModalDialog to open the popup window. I am sending one object from parent window to child window and doing some processing in child window. Now I have to set the values in the parent window based on the calculations in the child window.
I came to know that from the child window, we can set the values for the controls which are in parent.
I appreciate if some one can let me know how to do this…..
Thanks in advance,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
|
Thanks Paul for responding to my query.
I saw this article. Nice one. Unfortunately, I didn't find the solution for my problem. In this Article, Colin focused on passing the data from Parent to child but not child to parent.
I am sending some data from the parent form to child in the form of object, when the user closes the popup window; I want to populate the controls which are placed on parent form, with the data which is processed in child form.
Thanks,
Rahi
-- modified at 23:45 Saturday 28th July, 2007
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I thought you were going from child to parent, my misunderstanding
Good way to pass data from parent to child could be to modify the constructor for the child form to have a parameter that is the data you want to pass. For example, if I wanted to pass a string from MyTextBox.text from the parent to child, I could do something like:
<font> ...
Dim MyChildForm As New ChildForm( MyTextBox.text )
MyChildForm.Show ' or ShowDialog
</font>
In the code for ChildForm, you would have the constructor look like:
<font> Dim Private MyParentString As String
Public Sub New(ByVal MyTextString As String)
MyParentString = MyTextString
End Sub
</font>
Change the form names to the ones you are using, and the data and datatype of what you are passing.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Sorry Paul,
i sent the wrong message...just now i modified my message.
i am able to pass the data(in the form of object) from parent to child. my problem is i have to pass the data from child to parent.
when user clicks on Close Button on child(pop-up window), i have to populate the controls which are on Parent form.
Thanks once again for your response...
Rahithi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
The child form, you could overload the Close method with something like:
Overloads Function Close() As { Your-DataType-Of-Data-To-Pass-Back }
Return { The-Data-You-Want-Parent-To-Get-From-Child }
End Function
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Ok!! i will try this .
but one more simple doubt.........is it possible to directly populate the data in the parent controls using this overloaded close function??
Many Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Are you loading a dataset or something like that (datatable adapter, datarows, etc) in the child form? If so, pass the dataset back as a return value from the overloaded Close function.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
paul,
thanks alot for your answer!!!!!
i am sending Collection (object) to child window. almost 20 records(30 columns per record) of data but now i need only 4 values (need to populate 4 text box controls)from child window.
i heard that if we use Show model dialogue to open the pop-up window, we can directly access the Parent winodow controls in the pop-up window, so that we can set the values directly from child window it self..i mean no need to pass the data using sessions..or anything...
please discard my statement if it is wrong.......i am new to .Net technology.......this is my first project.
when user hits on Close button on child window, parent window gets focused....at the same time we have to show these values on parent.
any idea???????????
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi Rahithi
Add this property to your child form:
Private Readonly Property OwnerForm As ParentForm
Get
Return Me.OwnerForm
End Get
End Property Now you can access any property you expose on your parent form from your child form's Close event.
HTH
|
|
|
|
|
Hi everyone,
I've been trying to select (from the code) a specific cell in the DataGrid control to change it's value.
Exemple: if [cell].text = "" then [cell].text = "0"
I didn't actually find a way to do that. Can someone help me out?
Thanks!
|
|
|
|
|
Hi,
look at this code, i am checking the cell value when i am binding the data ....and if it is empty, then i am displaying it as '0'
hope this will give you some idea resolve your problem!!
Private Sub YourDataGridName_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles YourDataGridName.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
If e.Item.Cells(0).text="" then e.Item.Cells(0).text=0
End if
end sub
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
1. Could anyone tell me what code to use to check whetever the combobox selection is empty, Please? I tried the following code and didn't select any item, and both of them were error while compiling.
IsNullOrEmpty(combobox1.SelectedItem.ToString()<br />
combobox2.SelectedItem.ToString <> ""
2. Also, how do I "reset" a combobox? I mean, resetting the combobox that no item is selected? I tried this code, but it didn't work.
combobox1.selectedItem = ""<br />
combobox1.selectedText = ""
Could someone here give me a help, please?
Thank You Very Much. Ryan
|
|
|
|
|
Hi,
(I'm a C# guy, so when I say null you read Nothing)
A combobox holds a collection of items; their type can be anything (they are
Objects); often they are strings.
For selection you have properties:
SelectedItem: is an object, should be in the collection, or null
SelectedIndex: is an int, the index in the collection (zero based), or -1 for none
SelectedText: the result of SelectedItem.ToString(), or null/"" (not sure)
Test:
bool somethingGotSelected=cb.SelectedItem!=null;
Clear:
cb.SelectedItem=null;
Check the documentation, read about combobox, use MSDN;
and try to understand what you are doing !
you cant do cb.SelectedItem.ToString since SelectedItem could be null.
you cant do cb.SelectedItem="" unless "" is in the list
good luck.
|
|
|
|
|
i think with .net indexing, when no object is selected the selected index is set to -1. With a listbox you go:
if me.listbox1.selectedindex = -1 then<br />
' you know nothing is selected<br />
end if
It should be the same for the combobox. Same with the ressetting, probably set the selected index to -1.
|
|
|
|