|
How do you loop through controls in a form
<br />
For Each ct As Control In Me.Controls<br />
MessageBox.Show(ct.GetType.ToString) <br />
Next
I suppose ctList and the SSTab are third party tools. so you need to create an object of ctList and SSTab to access their properties. Common properties of a control like background, name, etc can be accessed in above mentioned way. Properties like HeaderFont, ColoumnCount are specific to that Control.
So You need to create that particular object to access their properties. Here is an example, this is for the textbox and this should be same for SSTab and CtList, i guess.
For Each ct As Control In Me.Controls<br />
MessageBox.Show(ct.GetType.ToString)<br />
ct.BackColor = Color.AntiqueWhite<br />
If ct.GetType.Name.Equals("TextBox") Then<br />
Dim tb As TextBox 'here you can use SSTab or whatever <br />
tb = ct<br />
tb.BackColor = Color.Blue<br />
End If<br />
Next
|
|
|
|
|
I'm writing a program which similar outlook expess. I wish create a formatting toolbar at form "new mail". I can create it with combo box, toolbox but I think there are other ways create it. Please help me. Thank
|
|
|
|
|
Hi , i know this is stupide but can you tell me what is assembly ?? & when can we use it ?? & why ??
thnx
try to be good if you can't be the best
|
|
|
|
|
|
thnx man this really very very interesting course it is more than enough but i think without practicing it i won't understand anything of it so please if you can send me real codes of assemliese & better if you can make explanation of each statement or instrection in or else give me a vedio if you have one that explain what is that sh*t
but anyway i want to thank you very very much
if you see that what i told you abt bringing informations is really herd or diffecult you can kick that sh*t away & i will try maself
thank you
try to be good if you can't be the best
|
|
|
|
|
Hi ,
please i want to know how can i fill the list box in form1 from the list box in form2
i will give the example to make it clear :
i have a listbox in form1 & i have an other one in form two
in form1 i have a botton & also in form2
well, when i click on button in form1, form2 is shown & i do somethings in & now i have a filled listbox in form2 i want when i click on the button in form2 the listbox in form1 get filled with items i have in listbox of form2
i hope you got it cuz ma english is really stupide just do your effort to understand because this is one of the last two problems i have now to finish my application
thank you very much
try to be good if you can't be the best
|
|
|
|
|
You should create a member variable in Form2 to store all items in its ListBox. You should add items to this member variable when you click Form2's button (an OK button?). Then create a public function in Form2 that'll return this collection of items.
Public Class Form2 : Inherits Form
Private selectedItems() As Object
'
Private Sub okButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles okButton.Click
' Copy selected items to array member variable.
' This array is returned on GetSelectedItems().
ReDim selectedItems(myListBox.Items.Count - 1)
myListBox.Items.CopyTo(selectedItems, 0)
End Sub
'
Public Function GetSelectedItems() As Object()
Return selectedItems
End Function
End Class
In Form1, you would display Form2 and fetch its ListBox items like this.
Dim myForm As New Form2
Dim selectedItems() As Object
myForm.ShowDialog()
selectedItems = myForm.GetSelectedItems()
|
|
|
|
|
Hi to all,
can anyone give me a head start on following problem:
I have an applications in which I add controls to a treeview (treeview = container). The problem is that when i scroll my treeview, the nodes move but the controls stay at their place ( the don't move in other words). ANy idea on how to make them move and keep their raltive position (now they are located next to the node which handles as the controls label)
kind regards,
Bats (Mike Martin)
|
|
|
|
|
i have used check constarin like this
constraint disignation CHECK(Designation IN('Key Person','Assignee')),
when i try to enter data using my code
it,s getting error on this constrain.
in the code i have used combo box and there fixed items.i access this item using "bombobox1.selecteditem"
but i check it using msgbox and it,s giving correct word.i,m confused with this coz i have used this on vb.net 2003
now i,m using vs2005
can any one help me
my quary string is like this
"insert into Complaint values('" & cbocustomerId.SelectedItem() & "','" & cborepID.SelectedItem() & "','" & cbosource.SelectedItem() & "','" & rtxtdescription.Text & "','" & cboempID.SelectedItem() & "','" & txtdate.Text & "','" & cbocatagory.SelectedItem() & "','" & cboFtype.SelectedItem() & "' ,'" & txtvehicleNo.Text & "','" & txtbustop.Text & "','" & cboOp_dept_no.SelectedItem() & "','" & cbostatus.SelectedItem() & "','" & txtrefNo.Text & "','" & txtplace.Text & "')")
-- modified at 7:39 Monday 22nd May, 2006
|
|
|
|
|
I have make a application that the user will open a whole day,
The application contains a folder watcher, when new file created in that folder,
A event will rise.
How can I set my application at the top of screen?
I have tried me.show, me.activate, me.WindowState = FormWindowState.Maximized ...
All these cannot work properly.
|
|
|
|
|
Hi,
If you are trying to make the window as top-most accessible window you should try to load it with .ShowDialog instead of show.
batmike2000
|
|
|
|
|
Hi ,
Can anyone tell me the code (in vb.net) to delete one record from the database. I m totaly confused about it. Plz tell.
Thanks.
Swati Pathania.
|
|
|
|
|
Hi,
Do you want sql query for that.
Best Regards,
Apurva Kaushal
|
|
|
|
|
no sql query
you have to use the dataset & the table in the dataset you have that record in
& you have two ways
if you are working with rownb
well i can't explain now but it is pretty easy give me just how you fill fields from database i meant the methode or the way you follow to reward your records & i will write you how to delete it with all the necessary explanation , are you happy ?? don't be confused nobody was born knowing everything
try to be good if you can't be the best
|
|
|
|
|
Mohammed Amine wrote: no sql query
you have to use the dataset & the table in the dataset you have that record in
If you are using a dataset, what do you think the .NET Framework sends to the database? A SQL Query. So there is a SQL Query.
The OP also did not say anything about using DataSets so this solution may not be advisable in his situation.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
yeah right , but how can he show filled fields without using dataset ??
i think if he want to update on database he is obliged to use it
so i asked him for the way he use to forward or to show his records in the fields that is all
sorry i didn't want to mean no sql query just i wanted to make it easy for him
try to be good if you can't be the best
|
|
|
|
|
Mohammed Amine wrote: yeah right , but how can he show filled fields without using dataset ??
There are many ways to show data without a data set. In general I rarely use them.
Mohammed Amine wrote: i think if he want to update on database he is obliged to use it
There is no obligation to use a dataset to update a database. The dataset is often a cumbersome representation of a database inside an application that can be more efficiently replaced. I only use datasets in throw away applications that I don't intent to maintain because they come with so many constraints.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
yeah you're right but i used to use that stuff because i often work on all the database that mean i get a lot of informations from all tables in ma DB so i need that representation on the memory
try to be good if you can't be the best
|
|
|
|
|
SwatiPathania wrote: Can anyone tell me the code (in vb.net) to delete one record from the database.
You don't mention what database. So, I'll assume SQL Server.
I've also assumed you have a String called connectionString which contains the connection string to your database. And, you have a variable called primaryKeyValue that matches the primaryKey of the row in the database that you want to delete.
Dim conn As SqlConnection = New SqlConnection(connectionString)
Dim cmd As SqlCommand = New SqlCommand
cmd.Connection = conn
cmd.CommandText = "DELETE FROM MyTable WHERE PrimaryKey = @primaryKey"
cmd.Parameters.Add("@primaryKey", primaryKeyValue)
cmd.ExecuteNonQuery()
Does this help?
DISCLAIMER: I'm not a VB.NET developer there may be some minor syntactic errors, but the logic is valid
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I didn't know you can parameterize Deletes or other SQL commands. I thought it was only queries, because everyone always referred to it as "Parameterized Queries".
I learned something new today and am quite embarrassed I didn't find this out sooner.
Thanks for posting this Colin.
|
|
|
|
|
Joshua Quick wrote: I thought it was only queries, because everyone always referred to it as "Parameterized Queries".
I can see how that would be confusing if you only consider select queries as queries.
Everyting in SQL are queries, regardless if it's a select, update, delete, create table, drop table, etc. That's why the term "parameterized queries" includes any SQL command.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: Everything in SQL are queries
Yeah... that's what the 'Q' in SQL stands for.
I just never think of non-select statements that way. Afterall, I'm not asking for anything when I do an insert or a create.
Well, that's why I like to monitor these boards (and articles). Every once in a while I'll learn something new.
Now I must go punish myself by writing "All SQL commands are queries" 100 times.
|
|
|
|
|
you can use the Currency Manager
Private withEvents cm as CurrencyManager
cm.Deletefrom(cm.Position)
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
This error is displayed when trying to create a setup file including an executable and a .dll.
The keycode does not appear within the source code of the original program, nor is a property of the .dll being used.
Any ideas?
|
|
|
|
|
I've a datagrid.datasouce = ds1
i can delete and add and modify the datatable through the datagrid.
after that click on the save changes, until every thing working fine.
but when i do some changes on the datagrid like delete a record and click on save button a system.Data.DBConcurrencyException throw.
----------------------------------------------------------------
Exception
----------------------------------------------------------------
system.Data.DBConcurrencyException: Concurrency violation: the
DeleteCommand affected 0 records. at
system.data.common.dbdataadabter.update(datarow[],
datatableMapping tableMapping) .....etc
----------------------------------------------------------------
that's mean the user can modify one time...
so what is this execption.
and how can i solve it
thanx
Militiaware
Faris Madi
|
|
|
|