|
I already edited my first post...
Seems to me you missed it.
[Marc] wrote:
EDIT: kut wrong forum
Public Const WM_NCHITTEST As Integer = 132
Public Const HTTRANSPARENT As Integer = -1
Protected Overrides Sub WndProc(ByRef m as Message)
If (m.Msg = WM_NCHITTEST)
m.Result = New IntPtr(HTTRANSPARENT )
Else
MyBase.WndProc(m)
End If
End Sub
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
-- modified at 17:03 Saturday 29th October, 2005
|
|
|
|
|
Thank you very very much, but can you complete your help and let me know how to use it. should this sub handle anythings??? when this sub was called???
sorry for your time....
and thanks again
OmarMallat
|
|
|
|
|
The WndProc sub has to do with the unmanaged Windows world. The Control class (from wich Label, Form etc are derived) is actually a kind of wrapper around the windows from Windows (now you know why it's called Windows ). When something happens to such a window, WndProc gets the message. Then, according to the message, it calls the right Method.
For example, if you press the left mouse button on a Label, WndProc gets some messages. First the WM_NCHITTEST message (WM is for Window Message). that asks what kind of surface is below the mouse. HTTRANSPARENT means 'Just click right trough me'. HTCLIENT means something like 'Give me (= the control/window) more mouse messages', and then WndProc gets those, for example WM_LBUTTONDOWN. When Control.WndProc gets the WM_LBUTTONDOWN notification, it calls the OnMouseDown method, and that method raises the MouseDown event.
Public Class ClickThroughForm
Inherits Form
Private Const WM_NCHITTEST As Integer = 132
Private Const HTTRANSPARENT As Integer = -1
Protected Overrides Sub WndProc(ByRef m as Message)
If (m.Msg = WM_NCHITTEST) 'If Windows asks what kind of surface the mouse is on
m.Result = New IntPtr(HTTRANSPARENT) 'Return that the mouse should go right through me
Else
MyBase.WndProc(m) 'Windows wants something else, let the base Control class do the work
End If
End Sub
End Class
Maybe i'll write an article about this
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
I used it.
it stop click on the form, but it didn't click through it.
OmarMallat
|
|
|
|
|
That's weird, over here it works fine. Anyhoo, i got it from this article[^]. In the article, the code is in C#. But you can download a demo plus source code in C# and Vb.net.
In that demo, there's a button with 'Visit our sponsor' on it. When the mouse hivers over it, a FloatControl pops up. When the mouse leaves the area of the button (under the FloatControl) the FloatControl goes away. So to me it seems that the mouse events go right trough the FloatControl. Is that about the same effect as you want?
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
-- modified at 19:12 Saturday 29th October, 2005
|
|
|
|
|
Private Const WM_NCHITTEST As Integer = 132<br />
Private Const HTTRANSPARENT As Integer = -1<br />
Protected Overrides Sub WndProc(ByRef m as Message) <br />
If m.Msg = WM_NCHITTEST THEN 'If Windows asks what kind of surface the mouse is on <br />
m.Result = New IntPtr(HTTRANSPARENT) 'Return that the mouse should go right through me Else <br />
MyBase.WndProc(m) 'Windows wants something else, let the base Control class do the work <br />
End If<br />
End Sub<br />
End Class
|
|
|
|
|
Hello!
I am trying to create a UserControl which is inherited by Forms.Panel control
I have declared a variable for PictureBox as a class field
Friend WithEvents pb As PictureBox = New PictureBox()
After the InitializeComponent call in the default constructor, I have added the following code
pb.Visible = True
pb.Location = New Point(0, 0)
pb.Size = Me.Size
pb.BackColor = Color.Black
pb.SizeMode = PictureBoxSizeMode.StretchImage
Me.Controls.Add(pb)
Me.AutoScroll = True
I know that the PictureBox and Panel Control do not raise KeyUp,KeyDown, KeyPress events
Is there any way I can process KeyDown, KeyUp messages in this control?
Actually I want to process the KeyDown event for drawing a Rectangle then moving and resizing it using arrow keys over the picture box.
After the user finishes setting the rectangle, the user will press the Enter Key and the Image in the picture Box will be cropped according to the rectangle.
I have tried override the OnKeyDown but it doesn't invoke.
Thanking you in advance
|
|
|
|
|
Your control needs to have the keyboard focus in order to get the event.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you for the reply
I have solved my problem by inheriting the ContainerControl instead of Panel.
(I hope it is good approach)
Thank You
|
|
|
|
|
hi!
(in Vb.net)I made a package that I take it from Crystall Report , and i install in it to the other PC . whenever i take a report , i recieve this Error :
con not find keycodev2.dll or invalid keycode
plz, help me!
thanks in advance!
yours!
mostafa hosseiny b.
|
|
|
|
|
hello guys:
i need help in mschartcontrol in vb6. actually i need help abt the plotting of the graph.i can feed values in the graph by declaring a 2D array and then using the chartdata property.
the problem is that the i have declared column count =1 and by right clicking the graph in the property window i have defined the series color RED.but when i plot the graph it plots in green color.
the second thing is that of the scaling of the y axis. i wish that the yaxis should show me the values up to 100. but when the program is executed it dislays the scaling according to the values given in the array.
can any body help me in this regard.
thanks.
|
|
|
|
|
Yeah, the mschart is pretty under documented. Take a look at the below sample code of mine. It should be a good starting point for you. It shows you how to setup a graph and how to turn auto-scaling off so that you can set your own axis min/max. The below code assumes your mschart.ocx control is named "chtGraph".
(I wrote this code without the IDE and in a hurry, but based on existing working code, so I hope it still compiles. )
<br />
Private Sub BuildGraph()<br />
Dim vData() As Variant<br />
Dim iMaxPoints As Integer<br />
Dim iIndexData As Integer<br />
<br />
' Activate error trapping.<br />
On Error GoTo catch<br />
<br />
' Do not init max to zero. Graph requires at least one point in<br />
' order to draw, otherwise control is drawn blank.<br />
iMaxPoints = 100<br />
<br />
' Setup data array to be added to graph.<br />
' Array is defined like this: vData(X,Y) where...<br />
' X is max number of points out of all plots.<br />
' Y is the number of axes your plot uses. 2 for 1 plot, 4 for 2 plots, etc.<br />
ReDim vData(0 To (iMaxPoints - 1), 0 To 1)<br />
For iIndexData = 1 To iMaxPoints Step 1<br />
vData(iIndexData - 1, 0) = CDbl(Rnd() * iMaxPoints)<br />
vData(iIndexData - 1, 1) = CDbl(iIndexData)<br />
Next<br />
chtGraph.RowCount = iMaxPoints<br />
chtGraph.ColumnCount = 2<br />
chtGraph.ChartData = vData<br />
<br />
' Setup legend.<br />
chtGraph.ShowLegend = True<br />
chtGraph.Plot.SeriesCollection(1).LegendText = "Plot Line 1"<br />
<br />
' Setup axes.<br />
With chtGraph.Plot<br />
.UniformAxis = False<br />
With .Axis(VtChAxisIdY).ValueScale<br />
.Auto = False ' Turn auto-scaling off.<br />
.MajorDivision = 4<br />
.Minimum = 0<br />
.Maximum = 100<br />
End With<br />
.Axis(VtChAxisIdX).ValueScale.Auto = True<br />
.Axis(VtChAxisIdX).AxisTitle.Text = "X-Axis Title"<br />
.Axis(VtChAxisIdY).AxisTitle.Text = "Y-Axis Title"<br />
End With<br />
<br />
' Draw graph.<br />
chtGraph.Refresh<br />
Exit Sub<br />
<br />
catch:<br />
' Error occurred! Display error message.<br />
MsgBox "Error building graph!", vbCritical, "Internal Error!"<br />
End Sub<br />
|
|
|
|
|
hi,
I want to put a icon near the all the nodes of a treeview control.
The nodes , the nodes are creating at runtime from Oracle.
also how can i put one textbox near those nodes.
Paritosh
|
|
|
|
|
paritosha wrote: I want to put a icon near the all the nodes of a treeview control.
Did you take a look at the ImageIndex[^] property of System.Windows.Forms.TreeNode ?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I am having trouble working in visual studio 2005 trying to create an invoice. I have set up a dataset and I have tried using reports, crystal reports, forms, everything but it won't work! Help Please.
William Penington
|
|
|
|
|
It would be very helpful if you explain your problem with more detail.
|
|
|
|
|
Hi Gulfraz,
Could please help me in printpreview control of .Net.
I want to Print and view datagrid multiline in PrintPreview.
I want to make this kind of report
//Start Report
Report Header1 Report Header2
Page Header1 Page Header2
Datagrid Data
=========================================
Student ID Student Name
=========================================
1 Muhammad Waqas Butt
Line1 Continue End
2 Muhammad Waqas Butt
Line2 Continue End
3 Muhammad Waqas Butt
Line3 Continue End
=========================================
Page Footer Page Footer
Report Footer Report Footer
//End Report
Please tell me can you help me in this?
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
Hello Waqas!
I think Crystal Report is the best solution. Though, I am not an expert in using Crystal Reports, but if you have any problem in using Crystal Reports then you can ask me.
You could also use the 3rd party tool (I liked this tool very much) is "Janus GridEx for .NET" and "Janus GridExPrintDocument"
Thank You.
-- modified at 6:12 Monday 31st October, 2005
|
|
|
|
|
I'm having trouble installing my windows service on my machine. I'm running XP Pro SP2 and I use installutil from the VS 2005 Command Prompt to intall the service. Below is the text from the command window. After running this the service still does not appear in my list of services. I made sure the Computer Management console was closed before intalling, and also that I had admin rights on my machine. Any help would be appreciated!
<br />
Setting environment for using Microsoft Visual Studio 2005 x86 tools.<br />
<br />
c:\Program Files\Microsoft Visual Studio 8\VC>installutil C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.exe<br />
Microsoft (R) .NET Framework Installation utility Version 2.0.50215.44<br />
Copyright (C) Microsoft Corporation. All rights reserved.<br />
<br />
<br />
Running a transacted installation.<br />
<br />
Beginning the Install phase of the installation.<br />
See the contents of the log file for the C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.exe assembly's progress.<br />
The file is located at C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.InstallLog.<br />
Installing assembly 'C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.exe'.<br />
Affected parameters are:<br />
logtoconsole =<br />
assemblypath = C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.exe<br />
logfile = C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.InstallLog<br />
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\SupService\SupConsoleListener\bin\Debug\SupConsol<br />
eListener.exe assembly.<br />
<br />
The Install phase completed successfully, and the Commit phase is beginning.<br />
See the contents of the log file for the C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.exe assembly's progress.<br />
The file is located at C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.InstallLog.<br />
Committing assembly 'C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.exe'.<br />
Affected parameters are:<br />
logtoconsole =<br />
assemblypath = C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.exe<br />
logfile = C:\SupService\SupConsoleListener\bin\Debug\SupConsoleListener.InstallLog<br />
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\SupService\SupConsoleListener\bin\Debug\SupConsol<br />
eListener.exe assembly.<br />
Remove InstallState file because there are no installers.<br />
<br />
The Commit phase completed successfully.<br />
<br />
The transacted install has completed.<br />
<br />
c:\Program Files\Microsoft Visual Studio 8\VC><br />
<br />
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
I am trying to change the user-agent header sent by a web browser control in my application.
The method I used is catching the BeforeNavigation2 event fired by the control and stopping the request to change the header and finally re-send it. I keep getting a run-time error (80004005) that says the Method 'Navigate2' from the Web browser object failed. I can't figure out why this is. A curious thing is that when I add a message box before the Navigate2 method is called I don't get an error anymore. Could anyone tell me what am I doing wrong, or if another method of doing this exists.
Here is the code in my current event handler:
<br />
Private Sub Web2_BeforeNavigate2(ByVal pDisp As Object, ByRef URL As Variant, ByRef Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, cancel As Boolean)<br />
Dim strMyHeaderField As String<br />
strMyHeaderField = "User-agent: XNBROWSER" & vbCrLf<br />
If InStr(Headers, "XNBROWSER") = 0 Then<br />
cancel = True<br />
Web2.Stop<br />
'MsgBox("X")<br />
Web2.Navigate2 URL, Flags, TargetFrameName, PostData, strMyHeaderField<br />
End If<br />
End Sub<br />
Thank you.
|
|
|
|
|
Just a guess, but try wrapping your code in a If statement that checks pDisp:
Private Sub Web2_BeforeNavigate2(ByVal pDisp As Object, ByRef URL As Variant, ByRef Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, cancel As Boolean)
Dim strMyHeaderField As String
If pDisp Is Web2.Object Then
strMyHeaderField = "User-agent: XNBROWSER" & vbCrLf
If InStr(Headers, "XNBROWSER") = 0 Then
cancel = True
Web2.Stop
'MsgBox("X")
Web2.Navigate2 URL, Flags, TargetFrameName, PostData, strMyHeaderField
End If
End If
End Sub
|
|
|
|
|
It doesn't help. Still the same error. I suspect it may be something regarding the state of the Web browser object, which maybe it is changed after a short time ( time it takes me to click on the button of the message box). I don't know.
|
|
|
|
|
I'm creating aWindows Application Form with several textboxes.
How can I save all the textboxes to a file, so that I can re-use the informtion.
In the VB book they only talk about one textbox.
|
|
|
|
|
Just simple write all the textboxes to a file (remember using a delimiter. So that u can parse back the string read from the file)
<< >>
|
|
|
|
|
It works fine on small databanks, by on large ones, I get an error. And this is the funny part about this. Windows displays the Error Report Dialog, says Faulting Application (Event ID 1000)., by the program will still keep running, and if I do not press anything on the Error dailog. My program will run to it all finish. If it is faulting, why does it keep on running? The following information is from my EventLog:
Faulting application egdatabanktool.exe, version 1.0.2126.24660, faulting module unknown, version 0.0.0.0, fault address 0x1f48cbc1.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 65 67 64 ure egd
0018: 61 74 61 62 61 6e 6b 74 atabankt
0020: 6f 6f 6c 2e 65 78 65 20 ool.exe
0028: 31 2e 30 2e 32 31 32 36 1.0.2126
0030: 2e 32 34 36 36 30 20 69 .24660 i
0038: 6e 20 75 6e 6b 6e 6f 77 n unknow
0040: 6e 20 30 2e 30 2e 30 2e n 0.0.0.
0048: 30 20 61 74 20 6f 66 66 0 at off
0050: 73 65 74 20 31 66 34 38 set 1f48
0058: 63 62 63 31 0d 0a cbc1..
EXE NAME="EGDatabankTool.exe" FILTER="GRABMI_FILTER_PRIVACY"
MATCHING_FILE NAME="EGDatabankTool.exe" SIZE="49152" CHECKSUM="0x1344EF70" BIN_FILE_VERSION="1.0.2125.26583" BIN_PRODUCT_VERSION="1.0.2125.26583" PRODUCT_VERSION="1.0.2125.26583" FILE_DESCRIPTION=" " COMPANY_NAME=" " PRODUCT_NAME=" " FILE_VERSION="1.0.2125.26583" ORIGINAL_FILENAME="EGDatabankTool.exe" INTERNAL_NAME="EGDatabankTool.exe" LEGAL_COPYRIGHT=" " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.2125.26583" UPTO_BIN_PRODUCT_VERSION="1.0.2125.26583" LINK_DATE="10/26/2005 18:46:14" UPTO_LINK_DATE="10/26/2005 18:46:14" VER_LANGUAGE="Language Neutral [0x0]"
MATCHING_FILE NAME="essdataadapter.dll" SIZE="90112" CHECKSUM="0x7AB848C2" BIN_FILE_VERSION="1.0.2125.18678" BIN_PRODUCT_VERSION="1.0.2125.18678" PRODUCT_VERSION="1.0.2125.18678" FILE_DESCRIPTION=" " COMPANY_NAME=" " PRODUCT_NAME=" " FILE_VERSION="1.0.2125.18678" ORIGINAL_FILENAME="ESSDataAdapter.dll" INTERNAL_NAME="ESSDataAdapter.dll" LEGAL_COPYRIGHT=" " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.2125.18678" UPTO_BIN_PRODUCT_VERSION="1.0.2125.18678" LINK_DATE="10/26/2005 18:45:09" UPTO_LINK_DATE="10/26/2005 18:45:09" VER_LANGUAGE="Language Neutral [0x0]"
MATCHING_FILE NAME="Interop.ADOX.dll" SIZE="23040" CHECKSUM="0xD48F427C" BIN_FILE_VERSION="2.7.0.0" BIN_PRODUCT_VERSION="2.7.0.0" PRODUCT_VERSION="2.7.0.0" FILE_DESCRIPTION=" " COMPANY_NAME=" " PRODUCT_NAME="Assembly imported from type library ADOX" FILE_VERSION="2.7.0.0" ORIGINAL_FILENAME="Interop.ADOX.dll" INTERNAL_NAME="Interop.ADOX" LEGAL_COPYRIGHT=" " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.7.0.0" UPTO_BIN_PRODUCT_VERSION="2.7.0.0" LINK_DATE="10/07/2005 17:06:59" UPTO_LINK_DATE="10/07/2005 17:06:59" VER_LANGUAGE="Language Neutral [0x7f]"
MATCHING_FILE NAME="Interop.JRO.dll" SIZE="9216" CHECKSUM="0x4B86CABD" BIN_FILE_VERSION="2.6.0.0" BIN_PRODUCT_VERSION="2.6.0.0" PRODUCT_VERSION="2.6.0.0" FILE_DESCRIPTION=" " COMPANY_NAME=" " PRODUCT_NAME="Assembly imported from type library JRO" FILE_VERSION="2.6.0.0" ORIGINAL_FILENAME="Interop.JRO.dll" INTERNAL_NAME="Interop.JRO" LEGAL_COPYRIGHT=" " VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x4" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="2.6.0.0" UPTO_BIN_PRODUCT_VERSION="2.6.0.0" LINK_DATE="10/17/2005 13:27:50" UPTO_LINK_DATE="10/17/2005 13:27:50" VER_LANGUAGE="Language Neutral [0x7f]"
EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY"
MATCHING_FILE NAME="kernel32.dll" SIZE="930816" CHECKSUM="0xF60887C3" BIN_FILE_VERSION="5.1.2600.1560" BIN_PRODUCT_VERSION="5.1.2600.1560" PRODUCT_VERSION="5.1.2600.1560" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.1.2600.1560 (xpsp2_gdr.040517-1325)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xEC3A9" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.1560" UPTO_BIN_PRODUCT_VERSION="5.1.2600.1560" LINK_DATE="06/17/2004 17:58:35" UPTO_LINK_DATE="06/17/2004 17:58:35" VER_LANGUAGE="English (United States) [0x409]"
One thing more, is that the fault address (0x1f48cbc1) will always be the same, and if the run this program on the different computer it will be different address but show the same one each time the error happens on it. By the way my computer is: XP Pro (SP1), Dell 2.79 GHz, Ram 1 GB, DotNet 1.1 (Not SP1), ADO 2.7
If you have any ideas, please let me know.
J Hatfield
|
|
|
|