|
Dim myNewForm As New ClassA
myNewForm.Show()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Did u test it??
its open new form
I want it in the same from
'''I want solution to this problem plz
'''''I tried in Form1_Load
Dim obj As New ClassA
obj.Refresh() '' didnot work
obj.Update() ''' didnt work
AMR-CIS
|
|
|
|
|
Of course it opens a new form. You have created a new form, and if you want to see anything that you do to that form, you have to open it.
If you don't want to open another form, you shouldn't create another form.
---
b { font-weight: normal; }
|
|
|
|
|
You didn't specify that this is what you wanted to do. I has to guess at it based on what you posted and your code sample.
If you want this to happen in the already open form, why did you even both to create a new class and inherit the original form???
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you have a form called Form1, and you create an instance of that form, then the textbox you can see is the textbox that belongs to THAT instance. Creating a new instance will not give you any sort of access to the prior instance. Instead, you need to use delegates or references to the form to create communication between classes.
I see no reason to ever derive a class from a form, unless you're looking to inherit some UI from the base form and add additional UI in the new class. You're trying to access a textbox in the base class, and also making a copy of that string into a variable ( which is redundant ). I dunno what you hope to do with this, but creating an instance of classA will not give you access to the visible instance of Form1, any more than creating a new instance of Form1 would.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
You've got a full 101-key keyboard in front of you, use it!
SMS-speak is frowned upon here, and on just about every other programming forum.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
If you try typing full English words into google, you'll have more luck finding what you're after.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
In VB6 , how to save a picture from a certain picture box, that it's values were created using the PSet function .. not loaded directly through loadpicture() ?
Luay Al-wesi
|
|
|
|
|
W this simple code
u can save ur images
SavePicture Picture1.Picture, "c:\X.bmp"
repalce Picture1 w image disp
replace "C:\X.bmp" w ur fav path
Khalefa_13@yahoo.com
|
|
|
|
|
I tried that before .. it won't work unless the picture is already loaded from a file ... the picture I want to save is made used pset function ... I didn't work this way
Luay Al-wesi
|
|
|
|
|
I got it ... you have to write savepicture pic1.image , filepath
Luay Al-wesi
|
|
|
|
|
Suppose i have a String (abcdefghi.kkkkaaaa.ghghgh.kkklklk/kgkhg). Now i want to find how many times does dot occurs in the string.PLease help me out
Mohinder Singh
|
|
|
|
|
One way is to replace all periods in the string with an empty string, and then compare the difference in length between the strings.
Another way is to simply loop through the string an look for periods.
---
b { font-weight: normal; }
|
|
|
|
|
Use Split function with "." as the split parameter; it returns an array whose Lenght is the number of occurences of "." in the string
|
|
|
|
|
Perhaps you should reply to the original post instead of replying to my reply?
MohammadAmiry wrote: Use Split function with "." as the split parameter; it returns an array whose Lenght is the number of occurences of "." in the string
No, it doesn't. It returns an array where the number of items are one more than the number of periods in the string.
---
b { font-weight: normal; }
|
|
|
|
|
|
In the future please supply your teachers detail so the forum members can submit your homework for you and save you the trouble...
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
trans4mative wrote: So I need the code for:
OK. When are you going to write it?
We'll be glad to help when you run into specific problems. But noone here, or anywhere else for that matter, will write it for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello
I am pulling a table from access but the column headings in the database are not what I want to use on the user form. How to I change the Headings after the grid is populated???
Here is what I have so far...
The column it pulls from the DB is myID and myCustomer I would like to change to ID and Customer without editing the DB..
Thanks
<br />
Private Sub LoadCustomers()<br />
Dim objConnection As New OleDbConnection(strConn)<br />
<br />
objConnection.Open()<br />
<br />
If objConnection.State = ConnectionState.Closed Then Exit Sub<br />
Dim OleDbAdapter As New OleDbDataAdapter("SELECT * FROM CustomersTB", objConnection)<br />
Dim myDataSet As New DataSet<br />
<br />
Try<br />
OleDbAdapter.Fill(myDataSet, "CustomersTB")<br />
<br />
Dim dv As DataView = myDataSet.Tables("CustomersTB").DefaultView<br />
<br />
DGCustomers.DataSource = dv<br />
<br />
Catch ex As SqlClient.SqlException<br />
MessageBox.Show("There was a Connection Error.")<br />
Catch InEXOpp As InvalidOperationException<br />
MessageBox.Show("An Invalid Operation occured.")<br />
End Try<br />
<br />
End Sub<br />
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
I don't know what happen to my code, it can't go through the bolded code, are these database problem?or what?..PLease help me, i am mad with this problem
my code as below:
Dim connstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb"
Dim sqlquery As String = "Select * from StaffRecord where " & Field & " = '" & item & "'"
Dim aconnection As OleDbConnection = New OleDbConnection
aconnection.ConnectionString = connstring
Try
Dim adptPerson As New OleDbDataAdapter(sqlquery, aconnection)
Dim dsPerson As New DataSet
adptPerson.Fill(dsPerson, "PersonTable")
If dsPerson.Tables("dsPerson").Rows.Count > 0 Then
Dim dr As DataRow = dsPerson.Tables("PersonTable").Rows(0)
IC = dr.Item("IC")
Name = dr.Item("Names")
End IF
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
|
|
|
|
|
Hello,
I miss a call to the "Open"-Method on the Connection-Object. Maybe you don't need it on a OleDbConnection, but I use ODBC- and/or SQLServer-Connections and there it must be.
Besides I think the access of the table is false and should be
dsPerson.Tables("PersonTable")
BR
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
This is probably a really simple (dumb) question. I have a tabbed form with a datagrid on one of the tabs and the other tabs contain text boxes, etc.(fields) of the currently selected record. I allow the user to set filters for dates, status codes, etc. and then re-select the data from SQL into a dataset. Do I have to reset all of the databindings for the grid and text boxes on all of the tabs, or is there a refresh or other method I should be calling after the data is re-selected? I guess it boils down to, do I have to bind more than once or under what circumstances do I have to re-bind all of the datagrids and text boxes?
Auguy
|
|
|
|
|
I have a .dll (not even sure what type) that contains some functions. I'd like to call those functions from vb.net. I've heard that it is possible to write a "wrapper" to do this. How can I learn to do this? Alternatively, how would I best call those functions from vb.net itself?
I really need a basic tutorial -- can anyone point me in the right direction?
Thanks!
|
|
|
|