|
No, you can't. You don't have direct control over the window of a seperate process.
The thing is that the external process does not know it's window is inside your window. It thinks and works exactly like it was running on the desktop. The desktop is itself a window, just like your Panel control.
If the user grabs the title bar of the external process, they can move the window around and your code will not know anything about it. There are no events that tell you if the external process window is being moved.
The users can also hit the minimize and maximized buttons on the external process window and they will work, just as if the window was on the desktop. You can't 100% stop that from happening.
|
|
|
|
|
EYESTRA1N wrote: I have my MyApplication.exe inside my form and I want it to be just fix on its location? Let me rephrase that; you want to remove the title-bar on a Window.
Go here[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you so much for the answers
It really help me a lot.
|
|
|
|
|
Hi,
I want to preview word (.docx) document on user form control in vb.net 2012. Please provide any solution!!! Urgent.
|
|
|
|
|
|
Hi Richard,
Already tried this but when followed the suggested code and steps, it is not previewing the document file in control, rather throwing dialogue box to either open / save file in respective software. but not in form.
And here in my scenario I want to view the document on form itself, in web browser control.
Any help will be highly grateful. Please...!!!
|
|
|
|
|
Danish1987 wrote: Already tried this Anything else you tried that I need not mention?
Danish1987 wrote: And here in my scenario I want to view the document on form itself, in web browser control. Why was this not in the original question?
If you want to show a docx in a webbrowser, you'll need Word to be installed on the client.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi to all Friends. first of all Excuse me for my bad english. I created an Address Label Print Program. I use PrintPreviewControl for Preview. When I click my Zoom Button about %100 in zoom is ok. Right Left Right And Bottom Margin Spaces are appear. But when 200% Zoom in PrintDocument is bigger size then PrintPreviewControl window. in this point Left and Top Margin Spaces are appear but Right and Bottom Margin Spaces not display.. can not appear. It seems like endless Paper.. I want to see right and bottom margin spaces also. in this page I found an program source codes.
http://www.codeproject.com/Articles/38758/An-Enhanced-PrintPreviewDialog
In this Program is codes are Locked can not change. I am not professional in VB.Net. thats why I just only want to know is there any simple way to see this right and bottom margin spaces at Zoom In (200%) mode. advanced thank you very much. God Bless all.
modified 10-Feb-14 17:51pm.
|
|
|
|
|
I need to send sms in vb.net windows application i tried many dll and gateway i ended in vain pls help me
|
|
|
|
|
Do not post the same question in multiple forums
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
I'm trying to run a sql statement and the parameters are based on date range and an item if the checkbox is checked. So far I get the right query result if the checkbox is checked but without it I'm getting "Command parameter 2 is invalid". Any help is appreciated. Thanks!
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim sqlsearch As String
Dim con As New OleDb.OleDbConnection
Dim date1 As String = DateTimePicker2.Value.ToShortDateString()
date1 = date1 + " 00:00:00"
Dim date2 As String = DateTimePicker3.Value.ToShortDateString()
date2 = date2 + " 23:59:59"
Dim scanner As String = ComboBox5.Text
con.ConnectionString = "provider=SQLOLEDB;data source=myserver;database=mydb;user ID=user;password=mypassword;"
If CheckBox1.CheckState = CheckState.Checked Then
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? AND hw_name = ? order by check_out_date desc"
Else : CheckBox1.CheckState = CheckState.Unchecked
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? order by check_out_date desc"
End If
Dim adapter As New OleDbDataAdapter(sqlsearch, con)
With adapter.SelectCommand.Parameters
.AddWithValue("@startDate", date1)
.AddWithValue("@endDate", date2)
.AddWithValue("@scanner", scanner)
End With
Dim dt As New DataTable("ScannerHistory")
adapter.Fill(dt) -- "This is where I'm getting the error."
DataGridView1.DataSource = dt
End Sub
|
|
|
|
|
In the 1st query you are passing in the 3 parameters correctly but in the 2nd query you are only passing in 2 parameters - no 2rd parameter so your add with value for scanner breaks the command!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I noticed that after I posted my question. I'm trying to see how to incorporate the 3rd parameter. Thanks!
|
|
|
|
|
Figured it out. Thanks for the feedback!
If CheckBox1.CheckState = CheckState.Checked Then
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? AND hw_name = ? order by check_out_date desc"
Else : ComboBox5.ResetText()
sqlsearch = "SELECT TOP(200) hw_name,[type],[status],wh_function,[user],check_out_date FROM tran_log WHERE check_out_date BETWEEN ? AND ? AND hw_name != ? order by check_out_date desc"
End If
Dim adapter As New OleDbDataAdapter(sqlsearch, con)
With adapter.SelectCommand.Parameters
.AddWithValue("@startDate", date1)
.AddWithValue("@endDate", date2)
.AddWithValue("@scanner", scanner)
End With
|
|
|
|
|
I am trying to add VLC component to VB.Net 2008 Exprees Edition form.
Project build successfully but at runtime getting following error.
"An error occurred creating the form. See Exception.InnerException for details. The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
Kindly Help...
|
|
|
|
|
Try going into your project properties and change the build Target CPU to x86. If your library is 32-bit only (most are!) you cannot compile your code as AnyCPU as that will make your code run as 64-bit on a 64-bit machine and 32-bit on a 32-bit machine.
You cannot mix 32- and 64-bit code in the same process.
|
|
|
|
|
hI my name is vishal. I building vb6 application with ms access using adodb. I have a form which contains label,combobox and 2 buttons.The form loads required data that I use when combobox is clicked.But given below is line where I am getting errors. The query below I take from 4 tables.
table1: name:Inward
Column Name DataType
mfr_ref_number Text
no_of_bundle Integer
supplier_id Integer
DC_date Date/Time
INV_date Date/Time
row_upd_date Date/Time
courier_name Text
inward_type Text
user_id Long(contains values 0 for all)
DC_NO Text
closed_status Boolean(true for some agn only)
to_dept Text
agn Long
table2:name:item_mater
Column Name DataType
user_id Long(contains 0 as value for all)
row_upd_date Date/Time
status Boolean
item_name Text
item_parent Long
item_price Double
item_desc1 Memo
item_desc2 Memo
item_desc3 Memo
item_type Long
item_code Text
agn Long
measure_type Text
table3:name: Stock_Register
Column Name DataType
row_upd_date Date/Time
technician_id Long
user_id Long(contains 0 as value for all entries)
in_out_type Integer
status Boolean
item_id Long
qty_debit Double
qty_credit Double
in_out_id Long
store_no Long
sl_no Text
ref_id Long
table4:name:store_master
ColumnName DataType
rack_name Text
rack_desc Memo
user_id Long(contains 0 as value for all entries)
row_upd_date Date/Time
status Boolean
store_no Long
I have to show agn field from table named Inward,item_name field from table named item_master,no_of_bundle field from table named Inward,rack_name field from table named store_master,store_no field from table named store_master.
When I tried the below query I get message that datas are not found for any agn. But in fact there are datas for agn I just need to check with another table named Stock_Register. i have tried query below:
SELECT [Inward].[agn], [item_master].[item_name], [Inward].[no_of_bundle], [store_master].[rack_name], [store_master].[store_no]
FROM (Inward INNER JOIN store_master ON [Inward].[store_no]=[store_master].[store_no]) INNER JOIN item_master ON [store_master].[user_id]=[item_master].[user_id]
WHERE [item_master].[status]=True And [Inward].[deleted_status]=False And [Inward].[closed_status]=False And [Inward].[agn]<>0 And [store_master].[status]=True;
Can anyone help me guide in fixing my sql select query using joins.Any help or guidance would be greatly appreciated.
|
|
|
|
|
This has nothing to do with VB or VB.NET. This is entirely a SQL question. Ask this in the Databases section.
|
|
|
|
|
1. See Dave's comments.
2. VB6 is no longer supported; no new development should be done in VB6 unless no other option exists
3. See Dave's comments.
|
|
|
|
|
Member 10248768 wrote: I building vb6 application
Then you are an idiot - download VB.net express. While there may be some justification in maintaining VB6 there is absolutely no reason to be building a project using a language that has not been supported for more than a DEACADE!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Ho interesting stuff, I did not think there were... no I'll just shut up now. However I did add some commentary to Colin's response!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The fact that Latin is not extinct does not mean that we should write manuals in it.
It is an unsupported language - all those open source projects might stop working tomorrow due to some windows-update. People will be whining about Microsoft, while they've had more then ten years to migrate.
It's as much as a feasable target for development as the Atari ST environment; while there still may be some enthousiast playing with it, we do not consider them to be 'active' platforms.
VB6 is not pinin' - it is bereft of life, it has ceased to be, it is an ex-language.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have multiple combobox which pulls all its information from several sql tables. The records are being populated but unable to insert into a sql table (tran_log) once data's are selected. I found a scripts which prompts me that I have a successful connection to my DB and that an insert has been made but the records are not being updated. I tried 2 different scripts but still no luck. Also, I get an error regarding objcmd.ExecuteNonQuery() from both scripts that's why its commented. Thanks!
Script 1:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim acsconn As OleDbConnection = New OleDbConnection _
("provider=SQLOLEDB;data source=DBserver;database=myDB;user ID=user;password=mypassword;")
acsconn.Open()
If acsconn.State = ConnectionState.Open Then
MsgBox("Connected")
Dim strsql As String = "insert into tran_log(hw_name,[type],[status],wh_function,[user],check_out_date)values(?,?,?,?,?,?);"
Dim objcmd As New System.Data.OleDb.OleDbCommand(strsql, acsconn) ' the oledbcommand
With objcmd
.Parameters.AddWithValue("@ComboBox1", ComboBox1.SelectedItem)
.Parameters.AddWithValue("@TextBox1", TextBox1.SelectedText)
.Parameters.AddWithValue("@ComboBox2", ComboBox2.SelectedItem)
.Parameters.AddWithValue("@ComboBox3", ComboBox3.SelectedItem)
.Parameters.AddWithValue("@ComboBox4", ComboBox4.SelectedItem)
.Parameters.AddWithValue("@DateTimePicker1", DateTimePicker1)
End With
Try
objcmd.Connection.Open()
Dim rowsAffected As Integer = objcmd.ExecuteNonQuery()
Console.WriteLine("RowsAffected: {0}", rowsAffected)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
'objcmd.ExecuteNonQuery()
objcmd.Dispose()
MsgBox("Saved")
End If
acsconn.Close()
End Sub
Script 2:
Dim strcom1 As String = ComboBox1.SelectedText
Dim strcom2 As String = TextBox1.SelectedText
Dim strcom3 As String = ComboBox2.SelectedText
Dim strcom4 As String = ComboBox3.SelectedText
Dim strcom5 As String = ComboBox4.SelectedText
Dim strcom6 As New DateTimePicker()
Dim objconnection As OleDb.OleDbConnection = Nothing
Dim objcmd As OleDb.OleDbCommand = Nothing
Dim strconnection As String, strSQL As String
strconnection = "provider=SQLOLEDB;data source=DBserver;database=myDB;user ID=user;password=mypassword;"
objconnection = New OleDb.OleDbConnection(strconnection)
objconnection.ConnectionString = strconnection
objconnection.Open()
strSQL = "insert into tran_log(hw_name,[type],[status],wh_function,[user],check_out_date)values(@ComboBox1,@TextBox1,@ComboBox2,@ComboBox3,@ComboBox4,@DateTimePicker);"
objcmd = New OleDb.OleDbCommand(strSQL, objconnection)
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox1", strcom1))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@TextBox1", strcom2))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox2", strcom3))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox3", strcom4))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox4", strcom5))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@DateTimePicker", strcom6))
objconnection.Close()
MessageBox.Show("Entered Successfully!")
|
|
|
|
|
Gentry_38 wrote: Also, I get an error regarding objcmd.ExecuteNonQuery() from both scripts that's why its commented.
If you don't execute the command, then it's no surprise that the command won't be executed, and your database won't be updated!
You need to call the ExecuteNonQuery method, so concentrate on fixing the error. If you can't fix it yourself, post the details of the error here and someone will probably be able to help you with it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|