|
I'm creating this asteroids-like game in vb for this vb class that I'm in and I need to be able to have multiple keys performing their functions at the same time. I am currently using the preview key down event for each of the keys but with that if you have one key pressed down and press another one it stops performing the operations of the first key. My professor said i needed something like asynchronous key detection but I couldn't find anything on it in the searches i did. Can anyone help me out?
|
|
|
|
|
You need to use DirectX for this. Direct Show is going to give you that sort of control over keys. The other option is to pinvoke GetAsyncKeyState or GetKeyState.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I feel like this should be an easy task, but I am having some issues.
I have a tab control, call it tabControl1, and 8 tabs, call them tabPage1 - 8. The length of the text on each tab is different. I want to create a 'justified' look and put the tabs in two rows (similar to MS Word tools>options).
I can adjust the padding, which changes the padding for all the tabs. But when I do this, the longer of the two rows appears to float.
If anyone could give me some guidance on this or point me in the right direction I would appreciate it.
Thanks in advance.
|
|
|
|
|
I converted VB.NET 1.1 Windows application to 2.0.
It's MDI application with many MDI children.
Now I got strange error. When few diffrent MDI children opened at the same time, and then you close one child , the whole MDI parent form falls into infinite loop like trying to redraw other child. And there is no other way to stop it, but close application using Ctrl+Alt+Delete. The funny thing is it happen not with all children forms, but I cannot find the rule or reason why.
Can someone help?
Thank you in advance.
|
|
|
|
|
trying again
dim frm as childform
Click_event...
frm =new childform
frm.mdiparent=me
frm.show
|
|
|
|
|
Thank you for the response.
That was exactly what I was doing. And I found the cause of this error. Most of the child forms have Maximized state and that what makes error.It looks like form starts draw and redraw header of the form and maximize it in a endless loop. As soon as I set it to Normal, the error gone. Instead on a Load event i resized the child form to Client area of MDI form and also removed maximized button. It solved the problem, but it is not how I expected make it. I have about 60!!! child forms and I need to open each one and change setting.
|
|
|
|
|
Hi everybody,
I found some code to hook, low-level, the keyboard and the mouse.
After some changes to get it working with vb 2005, I get the following error:
"CallbackOnCollectedDelegate was detected ....."
This is some of the code:
Private Function LowLevelKeyboardProc( _
ByVal nCode As Integer, _
ByVal wParam As Integer, _
ByVal lParam As KBDLLHOOKSTRUCT) As Integer
If (nCode = HC_ACTION) Then
If wParam = WM_KEYDOWN Or _
wParam = WM_SYSKEYDOWN Or _
wParam = WM_KEYUP Or _
wParam = WM_SYSKEYUP Then
Return 1
End If
Return CallNextHookEx(hhkLowLevelKybd, _
nCode, wParam, lParam)
End If
End Function
Private Delegate Function LowLevelKeyboardProcDelegate( _
ByVal nCode As Integer, _
ByVal wParam As Integer, _
ByVal lParam As KBDLLHOOKSTRUCT) As Integer
Public Sub EnableKeyboard()
UnhookWindowsHookEx(hhkLowLevelKybd)
End Sub
Public Sub HookKeyboard()
Dim callback = New LowLevelKeyboardProcDelegate(AddressOf LowLevelKeyboardProc)
KeyboardHandle = SetWindowsHookEx(WH_KEYBOARD_LL, _
AddressOf LowLevelKeyboardProc, Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly.GetModules()(0)).ToInt32, 0)
GC.KeepAlive(callback)
End Sub
Doe someone knows what is going wrong?
Thanks,
Jurgen
|
|
|
|
|
Hi all
I am developing a VB application in which I have created a translucent form using SetLayeredWindowAttributes API. On sharing of this application using netmeeting or windows messenger the client system is unable to view the application properly. Kindly suggest.
Thanks in advance
Regards
|
|
|
|
|
There's nothing you can do. Layered Windows are not supported acrossed NetMeeting sessions. PrintScreen even has problems with it!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Is there any other way to make the form translucent which will be supported across Netmeeting sessions.
|
|
|
|
|
Nope.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi;
I have a field of type 'image' in a table where files are stored in binary form. How would I download the file in its actual form in vb.net or ASP.NET.
I use the ADODB.STREAM CLASS in Visual Basic 6 for this purpose but having problem in ASP.NET
BYE
|
|
|
|
|
Put this code in your page
Dim oAttachment As New GetAttach
Try
Me.Page.Response.Clear()
Me.Page.Response.ClearContent()
Me.Page.Response.ClearHeaders()
Response.ContentType = ""
Response.BinaryWrite(oAttachment.GetAttach(<The Id of your stored file>))
Response.AddHeader("content-disposition", "attachment; filename=" + oAttachment.ATTACH_NAME + "." + oAttachment.EXTENSION)
Me.Page.Response.End()
Catch ex As Exception
throw ex
End Try
GetAttach Class to call getter stored procedure
Public Function GetAttach(ByVal MyParameter As Integer)
Dim docFileReader As SqlDataReader
Try
Dim Myadapter As New SqlDataAdapter
Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Using command As New SqlCommand("GetAttachment", connection)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add(New SqlParameter("@MY_SP_PARAMETER", MyParameter))
connection.Open()
docFileReader = command.ExecuteReader
docFileReader.Read()
EXTENSION = docFileReader.Item("EXTENSION").ToString
ATTACH_NAME = docFileReader.Item("ATTACH_NAME").ToString
WEIGHT = docFileReader.Item("WEIGHT").ToString
Dim FileData(docFileReader.GetBytes(0, 0, Nothing, 0, Integer.MaxValue) - 1) As Byte
docFileReader.GetBytes(0, 0, FileData, 0, FileData.Length)
docFileReader.Close()
Return FileData
End Using
End Using
Catch ex As Exception
If IsNothing(docFileReader) = False Then
docFileReader.Close()
End If
Throw ex
End Try
End Function
|
|
|
|
|
How to create a page in which there is a static panels that remains static even if the page moves.
punam
|
|
|
|
|
Set the panel's max and min size to be the size you want.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If u want the panels to change and be related to the form...u may set the dock and anchor properties to the right selection.
and vise versa if u want the plane to be static and not changing its size even if the form's size had been changed, then u also go to the dock and anchor and set default selection for both of them
|
|
|
|
|
hello all,
am creating one application using vb.net 2005. my problem is in text boxes i have given tabindexes. but whenever i run that application and press the tab key it was not in index manner(goto first then second then some buttons and then third...) how to rectify this problem? my application contain 32 fields in one form.
and also some validation controls not working propherly. ie if first text box is blank in save button press it was shown the particular box is empty please fill but in other textboxes it was not shown error messages. how to wrote common validation for this purpose? please help me....
|
|
|
|
|
The tab order works, you need to check how you've set it.
We also need to see your code to understand why you're not using the validation controls properly, to get the result you want. The best way to do what you're saying is to have a validation summary control on the page.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
checking means am i create tabindexes serially or not? s am create taidexes serially textbox1 got tabindex1 and textbox2 got tabindex2 like wise am creating tabindex for buttons also. what i do now? and if my checkings r wrong means how do i check it? Please help me to solve the issue..
|
|
|
|
|
If this is dotnet are you using the 'tab order' wizard under the 'view' menu? or are you creating controls at run-time?
if your using vb6 then go in reverse order and set every tabindex to '0'. that will auto-increment every control's tab index that you set before the last one you set to '0'. or are you creating controls at run-time?
|
|
|
|
|
hello frnd,
thanks it is now working fine...
|
|
|
|
|
Hi all, I've stumbled onto a problem I can't find a solution to.
I have a custom data grid that has a auto complete feature. This feature needs to look at the data for the current document (this is not a sql type grid.) Since the program is a MDI interface, i have a set of variables that serve as the common point for any member that needs data about the current document.
The problem i have run into is that I need to reload the variables that are pointing to the common point variables when the current document changes, rather than just changing the common document pointers.
If this isn't clear:
Display-------->Selected document---------------->document collection
I want to make the display look at the selected document address, rather than the data in the document collection.
I've read the marshalling info, but since this is an auto-complete that is updated with info, it appears that copying to unmanaged memory will not solve the issue.
Anyone have any ideas short of creating a delegate function?
Thanks,
Tom
|
|
|
|
|
Your description of the problem is making the assumption that we know how you designed your app, so this is a generalization.
The "current document" in an application would normally be a pointer to an instance of the document. You wouldn't normally have to set any "global" variables to match the document since each document class would be keeping track of all the data that is specific to that document. The "current document" pointer would be used to get at that data.
If your document class implements callbacks, or some other methods or async methods, delegates would be the best way to go.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I not sure y everytime i pass the data from DATAGRID to EXCEL above more then 10 row then the datagrid pointer will skip after row 10 until the end.
So my excel will look like this let said u use number as the data value.i showing 1-15 data.
1
2
3
4
5
6
7
8
9
10
15
15
15
15
15
I just found the solution , wat a crazy solution i never expect.
I just drag the datagrid height longer then solve the problem .HAH!;P
-- modified at 21:16 Thursday 7th December, 2006
|
|
|
|
|
You have asked this question any number of times... did you actually debug and see what happens when the row becomes 10 or 11?
|
|
|
|