|
Hi Dave ,
I m using a split container.On Panel1 i created a panel and on that i am drawing the line .& trying to move on the MouseDown ,Move,Up for LineShape Controls.
But i am not able to drag the line while placing the cursor at any position on the line due to the logic problem exactly & loosing the grip of the line while placing the mousepointer & dragging the line not firing the MouseUp .
Regards,For1206
|
|
|
|
|
See code below, i have just tried this and it is fine. Form, with SplitContainer, and A PowerPack Line in the right Panel
Private _lineDrag As Boolean = False
Private _x As Integer = 0
Private _y As Integer = 0
Private Sub LineShape1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
_lineDrag = True
_x = e.X
_y = e.Y
End If
End Sub
Private Sub LineShape1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left And _lineDrag Then
LineShape1.X1 = (LineShape1.StartPoint.X + e.X) - _x
LineShape1.X2 = (LineShape1.EndPoint.X + e.X) - _x
LineShape1.Y1 = (LineShape1.StartPoint.Y + e.Y) - _y
LineShape1.Y2 = (LineShape1.EndPoint.Y + e.Y) - _y
Me.Refresh()
End If
End Sub
Private Sub LineShape1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LineShape1.MouseUp
If e.Button = Windows.Forms.MouseButtons.Left Then
_lineDrag = False
End If
End Sub
|
|
|
|
|
Hi Dave ,
Thanks its moving fine .
1) But my LineShape controls is slipping from the mouse pointer while moving . So not able to drag the line in a correct way ,Freely .
2) I am able to get the traces of line if resized on the Start point or End Point handles . & i have to refresh the Panel i.e., Parent of the Shapecontainer .
My way of doing the things .
SplitContainer -> Panel1 -> New Panel at runtime -- This Panel is parent for the shape controls .
The Same problem also coming for RectangleShape & Oval Shape also.
I have to press the mousebutton very forcefully & drag the control otherwise slipping from my mousepointer .
What to do ??For1206
modified on Friday, February 19, 2010 12:43 AM
|
|
|
|
|
Question?
I developed an application in vb6. Application is on 2 separate computers. I have SQL Server 2005 on 1 of them. My question is?
When i Add, Change or Delete data in the base i what that other application see the change that i made.
Something like a real-time. Can that be done?
Thanks.69 best number
|
|
|
|
|
you can refresh the active screen(form) using timer which will execute the DB updates, so the latest changes will be there.
|
|
|
|
|
I was thinking 2 use a timer.
But is there a function that will trigger the updates
|
|
|
|
|
|
Dear friend;
I want to print 1000 lines in one paper sheets using POS printer. How to do it? I need Vb.net Source code.
thanks
C.Kumarasinghe
|
|
|
|
|
You posted this question just 31 minutes ago, and just 12 minutes ago someone gave you an answer. Its rude to keep posting the same question, particularly when you have not bothered looking at the answer given. Bob
Ashfield Consultants Ltd
|
|
|
|
|
How to print 1000 line in one page? How to change Paper height? Please help with tested Answer
Printer is POS or any
Paper Roll or Continues paper
thank
C. Kumarasinghe
|
|
|
|
|
If the printer is a POS device that uses a roll of paper, I suspect you can just open the printer connection and just keep
printing lines until you have finished the output and then just close the printer device.
It maybe a case of referring directly to the developer info for the device available from the OEM.
|
|
|
|
|
If you want to print with a windows driver see the folowing link:
http://support.microsoft.com/kb/322090
A POS printer is not a graphical printer.
You have to send the data raw.modified on Thursday, February 18, 2010 1:24 PM
|
|
|
|
|
Hi,
I have a user control developed using C#. The user control class implements two interfaces.
How can I create an instance of C# user control in VB6.0 and call functions from the two interfaces.
It is possible for me to create the control and show it on the form using Controls.Add but then I am not able to typecast the variable for the control to an interface object.
I think I am missing something but don't know what exactly.
I am new to VB and project requirement asks me to do this using VB6.0
Any help or guidance on this front is appreciated.
|
|
|
|
|
You can use the .NET stuff from VB6 using the Interop Toolkit[^] from Microsoft. You can easily add both UserControls and Forms from the .NET environment to the VB6 environment.
There's also a CodeProject article[^] available with examples in C# I are Troll
|
|
|
|
|
Thanks for the link. I went through the article and am not very clear about whether existing controls from C# can be hosted on the VB Form. I have a few questions regarding the same.
1. Will I have to write the entire C# .NET code (for existing user controls) or can the exising controls be ported using the toolkit directly and used from VB6.0
2. Will it be possible to create instances of .NET controls dyanamically?
3. Will I be able to handle events from the C# controls? [Got the answer to this. Yes]
4. What would be the other broad issues that one can face while using this toolkit and regarding COM Interop.
5. Any application deployment issue that one can face and dependency of the toolkit being installed on the deployment site.
|
|
|
|
|
Q2A wrote: 1. Will I have to write the entire C# .NET code (for existing user controls) or can the exising controls be ported using the toolkit directly and used from VB6.0
There's some extra code required to communicate between the C# UserControl and VB6. You can use the templates that come with the toolkit to create a new UserControl, that way all the required code will be added automatically. You can also copy these routines to an already existing UserControl.
Q2A wrote: 2. Will it be possible to create instances of .NET controls dyanamically?
Yup
Q2A wrote: 3. Will I be able to handle events from the C# controls? [Got the answer to this. Yes]
4. What would be the other broad issues that one can face while using this toolkit and regarding COM Interop.
That's possible, but it's a bit slower than a .NET event.
Q2A wrote: 5. Any application deployment issue that one can face and dependency of the toolkit being installed on the deployment site.
You should be fine as long as the toolkit is installed I are Troll
|
|
|
|
|
Thank you for your response. This will help me in the implementation.
|
|
|
|
|
You're welcome
|
|
|
|
|
One more question.
When I dynamically created the control from C# in VB6.0 using Controls.Add I was not able to see the changed text in the text boxes. The text should have been modified in the text boxes and I am able to get the new text every 2 seconds in another file. Is this issue because of COM interop and will it be resolved using the toolkit. Any ideas on what I may be missing?
|
|
|
|
|
Q2A wrote: Add I was not able to see the changed text in the text boxes. The text should have been modified in the text boxes and I am able to get the new text every 2 seconds in another file.
I don't completely understand what you're trying to do, so I'll try to reformulate the question first.
You created a C# control, and loaded it in VB6. The C# control has some textboxes, and they should contain the data from a file. And if you open the C# control from a VB6-application, the textboxes are empty?
Where are these textfiles stored?I are Troll
|
|
|
|
|
Hello,
Is there an API that i can use to remove cached username(s) and password(s) that are used to connect to a network share
When I'm removing a network share from Windows the username(s) and password(s) are cached.
Below is the function i use to remove the share.
Private Declare Function WNetCancelConnection2 Lib "mpr.dll" Alias "WNetCancelConnection2A" _
(ByVal lpName As String, ByVal dwFlags As Integer, ByVal fForce As Integer) As Integer
Thanks in advance.modified on Thursday, February 18, 2010 3:46 PM
|
|
|
|
|
andre de jong wrote: When I'm removing a network share from Windows the username(s) and password(s) are cached.
No, they're not. Windows does not cache that information. Perhaps you're talking about a users persisted drive mapping?
|
|
|
|
|
When I,m mapping a network Share with the WNetAddConnection2 function and then remove the share again
I can add the share with the same function again but without providing a username and password.
Even after a reboot.
Private Declare Function WNetAddConnection2 Lib "mpr.dll" Alias "WNetAddConnection2A" _
(ByRef lpNetResource As NETRESOURCE, ByVal lpPassword As String, _
ByVal lpUserName As String, ByVal dwFlags As Integer) As Integer
dwFlags = CONNECT_TEMPORARY
''' The network resource connection should not be remembered.
''' If this flag is set, the operating system will not attempt to restore the connection
''' when the user logs on again.
Is there a way to remove the username and password when the mapped network share is removed?
Or am I using the wrong "dwFlags"
|
|
|
|
|
andre de jong wrote: I can add the share with the same function again but without providing a username and password.
Even after a reboot.
andre de jong wrote: Is there a way to remove the username and password when the mapped network share is removed?
There is no cache of the username and password. It's that simple. You're trying to remove something that doesn't exist.
|
|
|
|
|
Thanks Dave for your help.
The samba server was the one that cached the cridentials.
|
|
|
|