|
i have a bounded combobox control on form in windows application, i tay to retrive selected value from it and try to show in a label control
but in label it not shows value,it shows system.datarow......
how i do it.
i write label1.text=combobox1.selectedItem
try to solve my problem.
|
|
|
|
|
hi Ajeet,
use following code
label1.text=combobox1.text
Hope this Helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
It's because the selected item is of type DataRow and when you assign it to the label1.Text the ToString method is called on the DataRow, which returns System.DataRow.
If you want to display the selected value in the label try:
label1.Text = combobox1.SelectedValue.ToString.
Mike Lasseter
|
|
|
|
|
The SelectedItem will return the DataRow object in the datasource that your box is bound to. Cast SelectedItem to a DataRow object, then you can use the DataRow's properties and methods to get the data you want out of that row.
Dim dr As DataRow = DirectCast(ComboBox1.SelectedItem, DataRow)
Dim id As Integer = dr("SomeIdColumnName")
|
|
|
|
|
can anyone tell me a way to replace a line and to remove.
I used this; doesn't work.
ex:-Richtextbox1.lines(0).replace("sdf")
|
|
|
|
|
In vb.net you do .Replace("sdf","") to remove that section.
Ben
|
|
|
|
|
If you could give a more clear coding it will be appreciated.
|
|
|
|
|
Your first error: The Replace method needs more than one parameter.
Your second error: The Replace method doesn't change a string, it returns a new string instance that contains the changes.
Richtextbox1.lines(0) = Richtextbox1.lines(0).Replace("sdf", String.Empty)
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Then you need to be more precise in you postings.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
Standard question #3:
What does your code look like?
---
single minded; short sighted; long gone;
|
|
|
|
|
no error messages just doesn't work.(doesn't do anything)
|
|
|
|
|
Standard question #3:
What does your code look like?
---
single minded; short sighted; long gone;
|
|
|
|
|
hello frnd,
i am using vb.net 2.0, i want the code to get the content of the word file page by page...
is there any idea....??
is any one have code .....????
Please Help...
-Koolprasd2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
the following code retrieves word by word
Dim mobjApp As Word.Application
Dim tmpRange As Word.Range
Dim tmpWords As Word.Words = mobjApp.ActiveDocument.Words
For Each tmpRange In tmpWords
If tmpRange.Text = "your text " Then
'do something
End If
Next
similary you can use
tmpParagraphs = mobjApp.ActiveDocument.Paragraphs
in order to retrieve paragraph by paragraph.
i think at both objects Words and Paragraphs
there is a property that you can tell you the page.
hope that helps
Isidoros
|
|
|
|
|
hello isidor7,
Thankx for your valueable help .
but if i read a page, word by word OR para by para then how can i come to know that the end of page is here.
suppose, if there is 10 pages then it is go on reading till the last page comes.. how can i come to know then that the page 1 is over and 2 is start ???
If u know plz help ....
thankx again for your reply
- koolparasad2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
I have a form with a progressbar and a dynamic graphic control
this dynamic control freezes when i run a method in the form.
so i run the method as a new thread in a class.
the problem is that the value of progress bar should depend to a variable in the method.
when i try to assign a value to the progress bar from the thread class I recieve the error message which says: the control is not created within the thread and can not access to its properties.
so how can i access to the value property of the progressbar?
A.E.K
|
|
|
|
|
|
well it's simple!
you have to declare your class with events
so when a value changes you will raise an event.
then...
your form will grab the event and from the form
you will setup the value property of your progress bar.
isidoros
|
|
|
|
|
Look into the BackgroundWorker component. It exposes a standardize method of reporting progress.
|
|
|
|
|
|
I've created a custom control that consists of two textboxes and a treeview. For the control i've added a new property:
Public Property Collection() As List(Of String)<br />
Get<br />
Collection = ItemsList<br />
End Get<br />
Set(ByVal value As List(Of String))<br />
ItemsList = value<br />
End Set<br />
End Property
When I add the control to a form and go to the collections property it offers an ellipses button that opens the 'string collection editor' which is built into Visual studio. This is what I wanted, however, when I click to add a new item to the collection it pops up an error message:
Constructor on type 'System.String' not found.
Can any one offer a solution as to why this is happening. I don't exactly understand what it means by constructer and I have no idea how to implement the constructor to add Strings to the collection.
What I want to do is be able to at least add individual items, then, eventually subitems etc.
Posted by The ANZAC
|
|
|
|
|
I use an API which accesses an information provider via a VPN. The API is declared as follows:
Dim objViewPoint As New DAT32COMLib.TerminalEmulation
The entire application hangs on this statement in .NET if the VPN is not up and running. (Works fine in VB6 where it simply returns an error or times out). The declaration is in an asyncronous process and I have also tried running it in a separate thread.
I would appreciate any suggestions.
Eldie
|
|
|
|
|
|
I haven't done Office Interop in quite a while. You'd find tons of examples if you just typed "vb.net Word automation" into Google.
|
|
|
|