|
|
Thank you very much!!
That's exactly what I was looking for. I had it working with a random number generator, but I think this will work better. Thanks again.
The fun part of programming is going to bed every night a more intelligent person.
Rob
|
|
|
|
|
Hello ...
I use .net by disconnected mode with Access database .
I want to make reports by the disconnected mode with Crystal report
But I realy failed . I want any one try to help me by any Example .
thanks for all
soly
|
|
|
|
|
|
i have make a program which enables you to draw on screen (on a form) using the mouse in any color and any size. It is really good and really useful, then one day when i fiddling with it i realized i could set timers to change the colors of the pen color to make it look 3-d, but when i ran it and compiled it, i was testing it, and it had errors like not changing the pen color, can someone help, here is my code:
if you find an answer or you need or would like either programs, just emai me on;
david-gee@hotmail.com
Option Explicit<br />
<br />
Private PointX() As Single<br />
Private PointY() As Single<br />
Private NumPoints As Integer<br />
Public c, j, c1, c2<br />
Private Drawing As Boolean<br />
<br />
<pre>
Private Sub Form_Activate()
c1 = vbBlack
c2 = vbBlack
c = 1
End Sub
</pre><br />
Private Sub Form_KeyPress(KeyAscii As Integer)<br />
Timer3.Interval = 1<br />
Timer4.Interval = 1<br />
If KeyAscii = 97 Then<br />
frmAbout.Visible = True<br />
frmAbout.Timer1.Interval = 500<br />
End If<br />
If KeyAscii = 49 Then<br />
Form1.cdbDialog.ShowColor<br />
c1 = Form1.cdbDialog.Color<br />
Form1.Enabled = True<br />
Form1.Visible = True<br />
Form1.WindowState = 2<br />
End If<br />
If KeyAscii = 50 Then<br />
Form1.CommonDialog1.ShowColor<br />
c2 = Form1.CommonDialog1.Color<br />
Form1.Enabled = True<br />
Form1.Visible = True<br />
Form1.WindowState = 2<br />
End If<br />
If KeyAscii = 32 Then<br />
NumPoints = 0<br />
Cls<br />
End If<br />
If KeyAscii = 43 Then<br />
If c = 1300 Then c = 1299<br />
DrawWidth = DrawWidth + 1<br />
c = c + 1<br />
Label1.Caption = c<br />
If c = 1300 Then c = 1299<br />
End If<br />
If KeyAscii = 45 Then<br />
If c = 1 Then<br />
Else<br />
DrawWidth = DrawWidth - 1<br />
c = c - 1<br />
If c = 0 Then c = 1<br />
Label1.Caption = c<br />
End If<br />
End If<br />
If KeyAscii = 48 Then<br />
DrawWidth = 1<br />
Label1.Caption = "1"<br />
c = 1<br />
End If<br />
If KeyAscii = 63 Then<br />
j = InputBox("Input a line width 1 - 1300", "Line Width", c)<br />
If j > 1300 Or j = 0 Then<br />
j = InputBox("Input a line width 1 - 1300", "Line Width", c)<br />
KeyAscii = 63<br />
Else<br />
c = j<br />
Label1.Caption = j<br />
Form1.DrawWidth = j<br />
End If<br />
End If<br />
End Sub<br />
<pre>
Private Sub Form_Load()
Label1.Caption = "1"
c = 1
Timer3.Interval = 1
Timer4.Interval = 1
AutoRedraw = True
End Sub</pre><br />
<br />
<br />
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)<br />
' Let MouseMove know we are drawing.<br />
Drawing = True<br />
<br />
' Start from scratch<br />
Timer3.Interval = 1<br />
Timer4.Interval = 1<br />
' Start drawing here.<br />
CurrentX = X<br />
CurrentY = Y<br />
End Sub<br />
<br />
<pre>Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' Make sure we are drawing.
If Not Drawing Then Exit Sub
' Save the new point.
NumPoints = NumPoints + 1
ReDim Preserve PointX(1 To NumPoints)
ReDim Preserve PointY(1 To NumPoints)
PointX(NumPoints) = X
PointX(NumPoints) = X
Timer3.Interval = 1
Timer4.Interval = 1
' Draw to the point.
Line -(X, Y)
End Sub
</pre><br />
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)<br />
' Stop drawing.<br />
Drawing = False<br />
<br />
End Sub<br />
<br />
<br />
Private Sub Option2_Click()<br />
End Sub<br />
<br />
Private Sub Form_Terminate()<br />
c1 = vbBlack<br />
c2 = vbBlack<br />
Unload Me<br />
End<br />
End Sub<br />
<br />
<pre>Private Sub Form_Unload(Cancel As Integer)
Unload Me
End
End Sub
Private Sub Label2_Click()
Form2.Visible = True
Form1.Enabled = False
End Sub</pre><br />
<br />
Private Sub Timer1_Timer()<br />
frmSplash.Visible = True<br />
frmSplash.Enabled = True<br />
Timer2.Interval = 1<br />
Timer1.Interval = 0<br />
End Sub<br />
<br />
<pre>Private Sub Timer2_Timer()
Timer1.Interval = 0
frmSplash.Timer1.Interval = 0
Form1.DrawWidth = Label1.Caption
Label1.Caption = Form1.DrawWidth
End Sub</pre><br />
<br />
<br />
Private Sub Timer3_Timer()<br />
If c1 = Form1.ForeColor Then<br />
Form1.ForeColor = c2<br />
Timer3.Enabled = False<br />
Timer4.Enabled = True<br />
End If<br />
End Sub<br />
<br />
<pre>Private Sub Timer4_Timer()
If c2 = Form1.ForeColor Then
Form1.ForeColor = c1
Timer4.Enabled = False
Timer3.Enabled = True
End If
End Sub</pre><br />
<big>if you find an answer or you need or would like either programs, just emai me on;</big> <br />
<br />
<div class="ForumSig">David Gee - david-gee@hotmail.com</div>
|
|
|
|
|
please help on how to kill network connection..
|
|
|
|
|
That depends on what you mean by "network connection". Is this a connection in your own app, or some other app? Are you trying to block traffic? Need more details...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
it is the other application that try to make connection..
|
|
|
|
|
Then no, you can't close it's connection directly. You have no access to the other app's connections.
The option you have is to either install your own proxy server, so your app connects to it and the proxy connects to your apps server, or write your own proxy server. In either case, you can break the connection, and even filter traffic, because you now have a "man-in-the-middle" that now controls one end of the connection.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If u able to know process ID u can end that process.
|
|
|
|
|
That's not what his post said he was looking for. That's kind of like killing the patient because he's got a cold.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello,
I want to compare an image to each image in an ImageList.
I tried this:
For Each Img As Image In ImageList1.Images
If Img Is [ComparePicture] Then
...
Next
What am i doing wrong?
I also tried: If ImageList1.Images.Contains([ComparePicture]) Then
...
End If
But then i get the message: "Specified method is not supported"?
Help pls?
|
|
|
|
|
You can't compare Image objects like that. If you want to compare the actual pixels, you'll have to write some code that will take both Image objects as arguments and do the comparison yourself. You'll probably want to first make sure that the images are the same dimensions, then the same color depth and pixel format, see if they have the same options (like a transparency), then go through each pixel, one-by-one, and compare them. If every pixel is the same, and all the other tests pass, then the images are equal.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks, Dave
--Zaegra--
|
|
|
|
|
Hello,
VS 2005
I have 2 datagrids.
The 1st datagrid will contain parts that the user will select and then click a button that saids add part. This part will be added to the 2nd datagrid. Which is the best method to add these rows to the datagrid. The fields will remain the same in both datagrids. So no need to change them.
Once the required parts have been entered into the 2nd datagrid they will be saved to the database. What is the best method so save the data in the 2nd datagrid, as the user can save periodically.
Many thanks in advance,
Steve
|
|
|
|
|
ive got a problem about adding flash in my apllication the system says failed to import the active x control what can i do i added active x please help
|
|
|
|
|
hi there,
I am new to VB2005 Express, and would like to know if it is possible to change the location of a picturebox via code at runtime.
In my program i have the screen cut into quarters and would like to display an image from one of the quarters to full size. The top left works like a charm. The others only fill half the screen from where they are.
Thank you.
|
|
|
|
|
You can change the Location, or Top and Left, properties to move the entire window. You then change the Size, or Width and Height, properties to change the controls size to whatever you want. All the properties of a PictureBox control are changable at run-time.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
when changing location, be sure to specify it as New . For example:
PictureBox1.Location = New Point(x,y)
Posted by The ANZAC
|
|
|
|
|
Thanks for all your replys.
|
|
|
|
|
Hi how do i kill explorer off, so it won't come back and how do i get a list and am able to control all the windows, any help apreciated
|
|
|
|
|
Explorer doesn't manage the windows. It's a shell that supplies the Desktop, Task Bar, and a navigation tool for exploring the file systems. It can be replaced, but it is not what gives you the look and feel of the windows themselves nor does it do any management of the windows.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i want to replace explorer, but in VB.net, any examples etc?
|
|
|
|
|
Not that I know of. There are commercial replacements out there, but nothing open source that I know of.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
do you know how to get the active windows and am able to get the process that the window bellongs to?
|
|
|
|