|
Main problem is that you are not adding text boxes to Forms control collection.
Try following code –
--------------------Start Code---------------
Dim xcnt As Integer
Dim x As Integer
x = 20
Dim txt As TextBox
For xcnt = 0 To 4
txt = New TextBox
Me.Controls.Add(txt) ‘you were missing this line
txt.Location = New Point(33 + x, 27 + x)
x += 25
Next
-------------------Code End---------------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
thank you sir dave, your help is very highly appreciated..
looking forward to you soon, many thanks..
start a new beginning in every ending; thats what life for......
|
|
|
|
|
hi,
how to convert Byte to IntPtr ?
Thanks & Regards
|
|
|
|
|
|
Have a look at the GCHandle class, it will tell you how to pin an object (such as a byte array)
to rpevent the GC from reshuffling it, and it will give you an IntPtr to it. Don't forget
to call Free() when you're done!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Dear All ,
We have Developed a Application with .net Remoting, that works fine but my problem is when any exception occurs in my business login(Remote Object ) My application gets terminated and my Clients accessing the remote object gets affected , is there any method to handle this situation .
|
|
|
|
|
put a try catch in you're remote object then when an exception occurs send a message to the clients (in the catch of finally of the try catch) who then can shut down or do something else (this will only work offcorse if the exception isn't one that there is no connection)
I'm not that experianced in remoting so there could be a better way
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
Hi all,
im new to vb .Net but loving it
can anyone help me, i want to specify a path in a textbox and then have a loop (not sure if i need a for each loop) look at each subdirectoy and return the name of the directories one by one in a messagebox.
i know its simple but i need to start somewhere
thank you
|
|
|
|
|
Use Directory.GetDirectories passing in the directory you want to start your search from.
Dim returnPath As String() = Directory.GetDirectories(txtDirectory.Text)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you,
i put this onto the button and altered it slighty
Dim returnPath As String() = System.IO.Directory.GetDirectories(txtdirectory.Text)
and that seems ok, dont i need a loop though to display each directoryname in turn?
thanks
|
|
|
|
|
If you like to click OK and close a lot of MessageBoxes go ahead and put it in a loop...
Otherwise string.Join all filenames (with Environment.NewLine) and show them all at once.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
yes i want to click ok to a lot of boxes, because then i want to progress the code from passing each one into a messagebox into something else.
please can you help?
thank you
|
|
|
|
|
Hi,
I have a gridview control in which i have added two comboboxes(cmbCity,cmbPincode) at the runtime.I populate the cmbCity combobox from the database at the form load event.
Now my requirement is that when ever i select an item from cmbCity ,the relevent picode should be automatically populated into cmbPincode.
Please help me out how to handle the cmbCity_SelectedIndexchanged event inside a gridview control..
Pradip kishore
|
|
|
|
|
Here is the problem:
I use Adodc control in vb6.0 to access sql server,everything works fine until when the network failed.
the code simply like this:
On Error ErrHandle
Adodc1.ConnectionString = "Provider=SQLOLEDB.1;user id=sa;password=123456;initial catalog=test;data source=192.168.1.23\SQLEXPRESS;Connect Timeout=30"
Adodc1.Recordset.Properties("prompt") = adPromptNever
Adodc1.RecordSource = "select *from admin"
Adodc1.Refresh
'other code
ErrHandle:
'do nothing
when the code run to Adodc1.Refresh,it pop up an error dialog with message "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server Not Exist or Access Denied"
It's normal that you can't access data base when the network is not working,but since my program is runing at the server host I don't want it to click the dialog all the time when it can't connect to sql server.
So is there some way that can avoid the error dialog? and let it goto ErrHandle Section
I have being run into this problem for several months, any advice would help.
thank you.
polarstar
-- modified at 4:02 Monday 24th September, 2007
|
|
|
|
|
Hi,
I am a beginer and I am trying to create a simple web browser using Visual Basic 2005 Express Edition.
What I need is this browser should be configured to use specific Java. That is the browser should use ONLY Java 1.3.1 or ONLY Java 1.4.2
As web browsers like IE can load Java applets, I want to do the same but restrict the version of Java used (example use only Java 1.3.1)
To make it easier to understand what I want .... here is the scenario....
The website to be accessed is an internal company website which uses an applet which runs only on Java 1.3.1
So the users of this website have to constantly disable the other java versions and restart their browsers just to be able to use this website. Due to unknown reasons the applet on this website cannot be upgraded at this time. So the only other solution is to make the browser use only Java 1.3.1 when accessing this website.
To make things easier for the users, I am trying to create a simple browser which uses only java 1.3.1 by default.
Is this possible?
Thank You for your help.
|
|
|
|
|
AFAIK the WebBrowser class uses the code and the settings of Internet Explorer,
so if you don't want to change IE's settings, that will not solve it.
My suggestion would be to install one more Internet Browser (FireFox, Safari, Maxthon, ...)
and change its settings to your specific requirement, then use that browser for your
intranet. That will be much easier than creating a whole new browser from scratch!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Warning 1 Unable to apply publish properties for item "axinterop.mscomctllib".
Warning 2 Unable to apply publish properties for item "axinterop.msforms".
Warning 3 Unable to apply publish properties for item "interop.mscomctllib".
Warning 4 Unable to apply publish properties for item "interop.msforms".
Warning 5 Unable to apply publish properties for item "msdatasrc".
***************
anybody there who can explain how to fix this warning message in VB2005 Express... Everytime i build or rebuild my VB Form project, it always warn me that kind of message.. but no error's message just a warning.. and my executable application still works..
but that is still a warning that means there is/are something missing or lacking in my project that needs attention..
Please help...
I think, I have already import all .dll's and com's i need in my vb project. but im not that so sure..
please be patient with me im just a newbie in VB programming this few months.. ehehe
|
|
|
|
|
When ever I try and add 'Microsoft Internet Controls' (which includes the Web Browser control) I get a message saying "File not found: 'C:\WINDOWS\system32\ieframe.dll\1'". Is there a way to get this back, because the Web Browser worked before.
Thanks in advance!
|
|
|
|
|
You can reinstall Internet Explorer. It usually updates all the dlls required for internet programming in VB6. Also its available for free download from Microsoft website.
when you want something, the universe conspires in helping you achieve it
|
|
|
|
|
hi guys,
can somebody help me and show me codes on how to save changes(in information) in datagridview connected to an SQL database. I was looking for codes ever since, but it doesn't work as i expected it to be.
I'm a beginner here, so I'm having a hard time creating the codes with datagridview.
Here's how it should work. I have DataSet1 and DataGridView1. When I run the program, i could add row/record to the datagridview, or edit, or delete record/s and save it onto the SQL database.
Hope anyone could help me here.
Thanks..;)
angeldeity
|
|
|
|
|
Abbhie wrote: can somebody help me and show me codes on how to save changes(in information) in datagridview connected to an SQL database. I was looking for codes ever since, but it doesn't work as i expected it to be.
I'm a beginner here, so I'm having a hard time creating the codes with datagridview.
Here is an example of how you can accomplish something like this:
Create two forms, call them Form1 and Form2. Put a DataGridView (DataGridView1) and a button (btnUpdateRow) on Form1. Create 3 textboxes on Form2 and call them txtId, txtFirstName and txtLastName.
Creating a sample dataset with 3 rows of data:
Public Table1 As DataTable<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Table1 = New DataTable("People")<br />
Dim Row1, Row2, Row3 As DataRow<br />
<br />
Try<br />
Dim Id As DataColumn = New DataColumn("Id")<br />
Id.DataType = System.Type.GetType("System.Int32")<br />
Table1.Columns.Add(Id)<br />
<br />
Dim FirstName As DataColumn = New DataColumn("First Name")<br />
FirstName.DataType = System.Type.GetType("System.String")<br />
Table1.Columns.Add(FirstName)<br />
Dim LastName As DataColumn = New DataColumn("Last Name")<br />
LastName.DataType = System.Type.GetType("System.String")<br />
Table1.Columns.Add(LastName)<br />
<br />
Row1 = Table1.NewRow()<br />
Row1.Item("Id") = 1<br />
Row1.Item("First Name") = "Pete"<br />
Row1.Item("Last Name") = "Soheil"<br />
Table1.Rows.Add(Row1)<br />
<br />
Row2 = Table1.NewRow()<br />
Row2.Item("Id") = 2<br />
Row2.Item("First Name") = "Bill"<br />
Row2.Item("Last Name") = "Gates"<br />
Table1.Rows.Add(Row2)<br />
<br />
Row3 = Table1.NewRow()<br />
Row3.Item("Id") = 3<br />
Row3.Item("First Name") = "George"<br />
Row3.Item("Last Name") = "Washington"<br />
Table1.Rows.Add(Row3)<br />
<br />
DataGridView1.DataSource = Table1<br />
Catch ex As Exception<br />
MessageBox.Show("Error: " & ex.Message)<br />
End Try<br />
<br />
End Sub<br />
Code to call the update Form2 and allow you to change row values:
Private Sub btnUpdateRow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdateRow.Click<br />
Dim SelectedRowIndex As Integer<br />
Dim SelectedRowCount As Integer = DataGridView1.SelectedRows.Count<br />
<br />
If DataGridView1.SelectedRows Is Nothing Then<br />
MessageBox.Show("Please Select a Row")<br />
Exit Sub<br />
End If<br />
<br />
If SelectedRowCount < 1 OrElse SelectedRowCount > 1 Then<br />
MessageBox.Show("Invalid Row Selection.")<br />
Exit Sub<br />
End If<br />
<br />
Dim SelectedRow As DataGridViewRow = DataGridView1.SelectedRows.Item(0)<br />
SelectedRowIndex = SelectedRow.Index<br />
<br />
Dim f As New Form2<br />
<br />
f.txtId.Text = SelectedRow.Cells(0).Value<br />
f.txtFirstName.Text = SelectedRow.Cells(1).Value<br />
f.txtLastName.Text = SelectedRow.Cells(2).Value<br />
f.ShowDialog()<br />
<br />
DataGridView1.Rows.Item(SelectedRowIndex).Cells(0).Value = f.txtId.Text<br />
DataGridView1.Rows.Item(SelectedRowIndex).Cells(1).Value = f.txtFirstName.Text<br />
DataGridView1.Rows.Item(SelectedRowIndex).Cells(2).Value = f.txtLastName.Text<br />
End Sub
I used a DataTable for my example, but if you want to use a dataset instead all you have to do is to add the datatable to a dataset and you are good to go.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
thanks for the reply.. i'll try these codes..
|
|
|
|
|
i have a simple doubt but i dont know how to do it..
actually i have displayed a database table in datagrid....
now i want to add or delete some values of data grid for dat i have given an edit button which opens a new form wid column name in labels and their values to be enterd in textboxes....
i want wen i click update button values get update with original datagrid window still opened..
database coding is not the deal..
important part is how can i update values of one form while focus on other form...
thanks in advance....
|
|
|
|
|
hi friends,
i'm new to reporting in win app.. so i need a great help.. my problem is..
i want to show a report that populate data from two tables. & i used the sql query like this.
dim _Ssql as string=""
_Ssql="Select d1.id, d1.name, c1.name from Dress d1, Color c1 where " _
& " c1.id=d1.c and d1.id=10 "
Hope u got my query...
i'm using the sql server , so i created a crystal report and add the fields from the two tables. now i used the below code to show the report
dim objds as new Dataset
dim _Cconnect as new GetConnection
objds=_Cconnect.GetAll(ssql)
dim crt as new Report1
crt.setDatasource(objds)
CrystalReportViewer1.ReportSource=crt
The main problem is when show the report it displays all the records.. but its not taking the data from dataset. ie it should show only 1 record.. How can i resolve this...
cheers...
|
|
|
|
|
need help.. How can I display the item or the currentcell that I doubleclickd in the datagridview in a textbox.. can somebody send me a code for that.. or how can I show the form displaying the details of the current cell I doubleclickd.
I have a project that is an inventory system.In my database I have a table called ComputerUnits, the fields are serialNo, itemDescription, itemCategory, dateAcquired,etc. I displayed all the serialNo's from my database in a datagridview. The problem is, how to display the information of a specific serialNo in a another form by doublecliking that serialNo in the datagridview. I'm just a beginner so pls help...
im using win app..
tnx a lot
gt
|
|
|
|