|
Thanks for the answer Pete,
This clears my confusion..
Fail early (throw exception in the constructor) is the preferred way.
Regards,
|
|
|
|
|
It's certainly the way I like to work. That way, I can tell whether or not I've wired my dependencies up properly.
|
|
|
|
|
hello can you help me in the code of projet :" Création d'un outil intelligent pour la vidéosurveillance" with vb.net 2008
|
|
|
|
|
No, nobody is going to just hand you code.
Ask a specific question about a problem you're having writing your own code and you might get a better answer.
|
|
|
|
|
Hello. I have this error when i load my from:
Unable to cast object of type
Private Sub followupfrm_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim myda As New SqlDataAdapter("select * from customers", mcon)
Dim myds As New DataSet
myda.Fill(myds, "customers")
cmbcustomer.DataSource = myds.Tables(0)
cmbcustomer.DisplayMember = "company"
cmbcustomer.ValueMember = "serial"
fillgrid()
End Sub
here where the error occures:
Private Sub cmbcustomer_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbcustomer.SelectedIndexChanged
txtticketnumber.Text = "9" + Format(cmbcustomer.SelectedValue, "0000")
End Sub
Any suggestions?
|
|
|
|
|
Member 10506215 wrote: Any suggestions? You may get a better chance of an answer in the Visual Basic forum. Also, show exactly which line the error shows on, and which item is the System.Data.DataRowView object.
|
|
|
|
|
The error occurs here:
txtticketnumber.Text = "9" + Format(cmbcustomer.SelectedValue, "0000")
|
|
|
|
|
|
|
|
|
Use a Try Catch Statement
Private Sub cmbcustomer_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbcustomer.SelectedIndexChanged
Try
txtticketnumber.Text = "9" + Format(cmbcustomer.SelectedValue, "0000")
Catch ex As Exception
End Try
End Sub
|
|
|
|
|
Try setting the DisplayMember and ValueMember properties before setting the DataSource property:
cmbcustomer.DisplayMember = "company"
cmbcustomer.ValueMember = "serial"
cmbcustomer.DataSource = myds.Tables(0)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Perfecto
setting the DisplayMember and ValueMember properties before setting the DataSource property worked perfectly.
Thank you.
|
|
|
|
|
hi
How to get the connection string in web api 4.0 from app.config file
|
|
|
|
|
|
I have a file collection 1-1.txt,1-2.txt,1-3.txt etc.
How can I get all files with start char 1-????
|
|
|
|
|
|
Hi to all.This Is Lakshmi Dhivya,Iam doing my Engineering on Information Technology(IT),and I have decided to make an editor with all possible formatting options.
I have selected vb.net as a programming language for my project.
I have started designing the Rich Text editor,but Iam unable to change the font size alone with different font text selected.I have added a font comobox and a size combobox,but i need to change font alone and size alone with different font text selected.
I request help from You all to finish my project
Thanks in advance to every one.
|
|
|
|
|
You have not really explained what the problem is. If you select a new font from the font combo then the current font size should be used. And if you select a new height then the current font should be used. Alternatively you could use the FontDialog class[^].
|
|
|
|
|
|
You have to create a new Font object, based on the previous font object, with the new FontSize. That's the bad thing with Fonts: they are immutable, and changing a property of a font can only be done be creating a new one with the different property.
|
|
|
|
|
I have found that in wordpad if you select a text content typed in different fonts the font combobox will not show any font and if you change the size, only the size of the selected text changes and not the fonts.
How To do this.
This Is my Problem,I think i have told the exact problem.
Awaiting positive response form you all.
|
|
|
|
|
Bernhard has explained what you need to do. Remember, what you see on the menu of Wordpad does not tell you what is happening internally. Every time you want to display characters in a particular font then you need to create a new one, even if you are only changing the size.
|
|
|
|
|
That means that you have to split the selection into regions with the same font, and then apply the method described above for each section individually.
|
|
|
|