|
It's been a while, but I think you want to look at the sendmessagee function in the win32 api.
|
|
|
|
|
Well you could use EnumWindows to get the list of all top level windows.
Then you could use EnumChildWindows to get the list of the child compoments inside the parent.
Since you are posting this in VB section i am asuming that you are using VB, then you can use AppActivate to set focus on the window and then SendKeys to send the keys to the window
To run an application you can use the Shell function which returns the process id if the program is running.
-------------------------------------------
Taken From MSDN 2003
-------------------------------------------
'Example
AppActivate("Untitled - Notepad")
SendKeys.SendWait("Hello world!")
' Send Ctrl S to open the Save As dialog box.
SendKeys.SendWait("^S")
' Send the name of the new file.
SendKeys.SendWait("c:\HelloWorld.txt")
' Send Alt S to save the file.
SendKeys.SendWait("%S")
-------------------------------------------
I hope the above helps
Life Is A Cipher Substituting "happiness" with "sadness" and Transforming "pleasure" into "pain"
|
|
|
|
|
SendKeys!! Thats what I was thinking of...
|
|
|
|
|
Yes that does help, thanks. I guess I just need to take them on one by one and see what works by trial and error.
|
|
|
|
|
Hi all
I have this project im converting from vb6 to vb.net
when i run the code advisor for vb6 it keep getting this fixit code.
'FIXIT: Declare 'currentdate' and 'tempDay' and 'tempMonth' with an early-bound data type FixIT90210ae-R1672-R1B8ZE
Dim currentdate, tempDay, tempMonth, tempYear As String
Dim tempDate As String
I go to the help file for this fixit but it does not explane it very well. Can any one explane it to me.
The Dim statements are my original code.
Ed
|
|
|
|
|
Declaring multiple variables with a single "Dim" strongly types only the variables with an "As" clause. So your first declaration declares three variants in VB6 and one string.
You get the message when upgrading since you *may* want to keep it as three objects and one string (the original intent of the VB6 code) - or more likely you originally intended four strings - VB.NET would regard it as four strings.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
|
|
|
|
|
Of course, I meant:
Declaring multiple variables with a single "Dim" strongly types only the variables with an "As" clause ***IN VB6***
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant C++: C# to C++ Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
|
|
|
|
|
|
:Nuke: Goodbye world!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
//Crystal Report Object
CrystalReport2 cp = new CrystalReport2();
CReport cp1 = new CReport();
//Form Load Event
private void Form2_Load(object sender, System.EventArgs e)
{
crystalReportViewer1.ReportSource = cp;
}
//Link Label Click Event
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
try
{
string empid = textBox1.Text.Trim();// H-B39728F employee id
SqlConnection con = new SqlConnection("server=SK-WAQAS;uid=sa;pwd=Butt;database=pubs");
SqlDataAdapter daemp = new SqlDataAdapter("Select * From employee where emp_id= '" + empid + "'", con);
DataSet ds = new DataSet();
daemp.Fill(ds,"employee");
cp.SetDataSource(ds);
con.Close();
}
catch(Exception ce)
{
MessageBox.Show(ce.Message);
}
}
// End Code
When i run this code no record show in Crystal Report. Please tell me where is do mistake. I want to show record in crystal report on the base of emp_id , i use pubs database on Sql server 2000.
Thanks in advance.
|Muhamad Waqas Butt|
waqasb4all@yahoo.com
www.sktech.freewebspace.com
|
|
|
|
|
I am developing a video conferencing program. It is intended to work on internet. I used AVICAP to capture video from webcam. The method i intended to used to stream video is capture a frame from webcam then send it over to the other PC and then repeat it again. The other PC will paste the frame received to the picture box upon receive the bmp file. My problem is I do not know i should choose either TCP/IP, UDP or socket as my connection method? And i do not know how to stream audio captured across internet. Can any1 give some help here either by giving me some sample video conferencing program (vb.Net) or giving some guildance and tutorial ?
-- modified at 2:43 Sunday 2nd October, 2005
|
|
|
|
|
|
See here[^]!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
What question?
All you've done is copy/paste in your homework assignment. This is a great way to your "question" ignored.
Ask something specific and we can help with that. The whole point of you getting a homework assignmnet is to see if you're understanding the what's being taught in the class and if you understand how to apply it to problems. If all you're doing is copying/pasting the assignment into a forum, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
this is the code I have been trying for hrs. Trackbar control only Vertical and horizontal. Now how do I control the diameter?
Public Class Form1
Inherits System.Windows.Forms.Form
Private paper As Graphics
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
paper = Me.PictureBox1.CreateGraphics
Me.VertTrackBar.Minimum = 0
Me.VertTrackBar.Maximum = Me.PictureBox1.Height
Me.Label1.Text = CStr(Me.VertTrackBar.Value)
Me.HoriTrackBar.Minimum = 0
Me.HoriTrackBar.Maximum = Me.PictureBox1.Width
Me.Label2.Text = CStr(Me.HoriTrackBar.Value)
Me.HoriDiaTrackbar.Minimum = 0
Me.HoriDiaTrackbar.Maximum = Me.PictureBox1.Width
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents VertTrackBar As System.Windows.Forms.TrackBar
Friend WithEvents HoriTrackBar As System.Windows.Forms.TrackBar
Friend WithEvents HoriDiaTrackbar As System.Windows.Forms.TrackBar
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents btnDraw As System.Windows.Forms.Button
Friend WithEvents Label3 As System.Windows.Forms.Label
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.VertTrackBar = New System.Windows.Forms.TrackBar
Me.HoriTrackBar = New System.Windows.Forms.TrackBar
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.HoriDiaTrackbar = New System.Windows.Forms.TrackBar
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.btnDraw = New System.Windows.Forms.Button
Me.Label3 = New System.Windows.Forms.Label
CType(Me.VertTrackBar, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.HoriTrackBar, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.HoriDiaTrackbar, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'VertTrackBar
'
Me.VertTrackBar.Location = New System.Drawing.Point(88, 48)
Me.VertTrackBar.Name = "VertTrackBar"
Me.VertTrackBar.Orientation = System.Windows.Forms.Orientation.Vertical
Me.VertTrackBar.Size = New System.Drawing.Size(45, 300)
Me.VertTrackBar.TabIndex = 0
'
'HoriTrackBar
'
Me.HoriTrackBar.Location = New System.Drawing.Point(152, 360)
Me.HoriTrackBar.Name = "HoriTrackBar"
Me.HoriTrackBar.Size = New System.Drawing.Size(300, 45)
Me.HoriTrackBar.TabIndex = 1
Me.HoriTrackBar.TickStyle = System.Windows.Forms.TickStyle.TopLeft
'
'PictureBox1
'
Me.PictureBox1.Location = New System.Drawing.Point(160, 40)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(300, 300)
Me.PictureBox1.TabIndex = 2
Me.PictureBox1.TabStop = False
'
'HoriDiaTrackbar
'
Me.HoriDiaTrackbar.Location = New System.Drawing.Point(152, 424)
Me.HoriDiaTrackbar.Name = "HoriDiaTrackbar"
Me.HoriDiaTrackbar.Size = New System.Drawing.Size(300, 45)
Me.HoriDiaTrackbar.TabIndex = 3
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(80, 384)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 40)
Me.Label1.TabIndex = 4
Me.Label1.Text = "Label1"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(472, 368)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(72, 32)
Me.Label2.TabIndex = 5
Me.Label2.Text = "Label2"
'
'btnDraw
'
Me.btnDraw.Location = New System.Drawing.Point(520, 168)
Me.btnDraw.Name = "btnDraw"
Me.btnDraw.Size = New System.Drawing.Size(88, 40)
Me.btnDraw.TabIndex = 6
Me.btnDraw.Text = "Draw"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(480, 424)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(64, 32)
Me.Label3.TabIndex = 7
Me.Label3.Text = "Label3"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(640, 486)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.btnDraw)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.HoriDiaTrackbar)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.HoriTrackBar)
Me.Controls.Add(Me.VertTrackBar)
Me.Name = "Form1"
Me.Text = "Form1"
CType(Me.VertTrackBar, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.HoriTrackBar, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.HoriDiaTrackbar, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub VertTrackBar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VertTrackBar.Scroll
Dim myPen As Pen = New Pen(Color.Black)
Me.Label1.Text = CStr(Me.VertTrackBar.Value)
paper.Clear(Color.White)
paper.DrawEllipse(myPen, 0, 0, Me.HoriTrackBar.Value, Me.VertTrackBar.Value)
End Sub
Private Sub HoriTrackBar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HoriTrackBar.Scroll
Dim myPen As Pen = New Pen(Color.Black)
Me.Label2.Text = CStr(Me.HoriTrackBar.Value)
paper.Clear(Color.White)
paper.DrawEllipse(myPen, 0, 0, Me.HoriTrackBar.Value, Me.VertTrackBar.Value)
End Sub
Private Sub HoriDiaTrackbar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HoriDiaTrackbar.Scroll
Dim myPen As Pen = New Pen(Color.Black)
Me.Label3.Text = CStr(Me.HoriDiaTrackbar.Value)
paper.DrawEllipse(myPen, 0, 0, Me.HoriDiaTrackbar.Value, Me.HoriDiaTrackbar.Value)
'paper.DrawEllipse(myPen, Me.HoriTrackBar.Value, Me.VertTrackBar.Value, Me.HoriTrackBar.Value, Me.VertTrackBar.Value)
'paper.DrawEllipse(myPen, 0, 0, Me.HoriTrackBar.Value, Me.VertTrackBar.Value)
End Sub
Private Sub btnDraw_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDraw.Click
Dim myBrush As SolidBrush = New SolidBrush(Color.Black)
paper.FillEllipse(myBrush, 100, 100, 10, 10)
paper.FillEllipse(myBrush, 200, 200, 10, 10)
paper.FillEllipse(myBrush, 200, 100, 10, 10)
End Sub
End Class
|
|
|
|
|
You still haven't supplied much information.
I take it you have to control both the position and the size of the circle.
You're drawing a cicle from the top/left corner of the picture box ALL THE TIME. You're not tracking the position of the circle at at all.
You have to track the center of the circle with the two trackbars. Easy enough, you already have them in place. Eliminate all the drawing code from the trackbars, you don't need any of it. The trackbar code will just alter the position and size of the circle. Then call the Invalidate method of the PictureBox control your painting on.
You only need a single Draw statement, inside the Paint event handler for the PictureBox control. Here is where you'll calculate the top/left and bottom/right corners of the box that will be used to draw your circle. It's simple math.
The top/left will be the position of the circle minus hald the diameter. The bottom/right will be the position plus half the diameter.
Don't even thnik of asking for the code. You're in a class to learn to write it yourself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thank you so much Master.
|
|
|
|
|
Dave
I took this challenge and found I'm having a tough time understang the logic flow of the object model.
I get the circle to draw in the center of the PictureBox, but it is fleeting - it disappears as soon as it is drawn. I debugged only to find the circle vanishes as soon as I exit the Paint event on the PictureBox.
Where am I failing?
Public Class Form1
Private _paper As Graphics
Private _pen As Pen = New Pen(Color.Black, 3)
Private Sub Form1_Load(....) Handles MyBase.Load
_paper = Me.uxCanvasPicbx.CreateGraphics()
End Sub
Private Sub uxDiameterTrkbar_Scroll(....) Handles uxDiameterTrkbar.Scroll
uxDiameterLbl.Text = uxDiameterTrkbar.Value.ToString
uxCanvasPicbx.Invalidate()
End Sub
Private Sub uxCanvasPicbx_Paint(....) Handles uxCanvasPicbx.Paint
Dim ul, lr As Integer
lr = Me.uxDiameterTrkbar.Value
ul = ((200 - lr) / 2)
_paper.Clear(Color.White)
_paper.DrawEllipse(_pen, ul, ul, lr, lr)
End Sub
End Class
Thanks,
Karen
Nooobie to OOP and VB.Net 2005
|
|
|
|
|
Karen,
Original question that I posted was How do I control the diameter of a circle. I was able to control the Horizontal and the Vertical.
|
|
|
|
|
The problem is because your using your own Graphics object and you don't need to. The Graphics object is supplied to you in the args for the Paint event. If you use your's, everything you paint will be overlayed by the Graphics object in the Paint event args.
Sooooo....
Public Class Form1
Private _pen As Pen = New Pen(Color.Black, 3)
Private Sub uxDiameterTrkbar_Scroll(....) Handles uxDiameterTrkbar.Scroll
uxDiameterLbl.Text = uxDiameterTrkbar.Value.ToString
uxCanvasPicbx.Invalidate()
End Sub
Private Sub uxCanvasPicbx_Paint(....) Handles uxCanvasPicbx.Paint
Dim g As Graphics = e.Graphics
Dim ul, lr As Integer
lr = uxDiameterTrkbar.Value
ul = ((200 - lr) / 2)
g.Clear(Color.White)
g.DrawEllipse(_pen, ul, ul, lr, lr)
End Sub
End Class
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I am receving stream of data from the serial port com1.
My problem is that what should I do to display this online data in graph or chart using VB6.0
Could someone pls enlighten me on this?
Thanks
|
|
|
|
|
does anyone know of a control (third-party or otherwise) that allows viewing/manipulation of an excel spreadsheet or a specific range on a spreadsheet?
|
|
|
|
|
Hi..Take a look here, should tell you all you need to know about automating Excel from .NET etc.. )
Understanding the Excel Object Model from a .NET Developer's Perspective
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/ExcelObj.asp
|
|
|
|
|
Hello,
ComponentOne has a control, XLS.NET, that will allow you to open and manipulate existing Excel files as well as create new ones. Rows and columns are accessed like a grid, so the object model will be familiar to most users. We also have a grid control, FlexGrid.NET, that allows you to load Excel files into the grid and save the grid layout and data to an xls file.
If you are interested, more information is available at http://www.componentone.com. All of our products are available as fully functioning evaluations at http://www.componentone.com/Downloadcenter.aspx?PanelIndex=4.
Happy Friday
Suelinda W
Customer Engagement, ComponentOne LLC
|
|
|
|
|