|
The < operator works with DateTime. So create your two range datetimes, and then check if your date > one and < the other. I'd write a helper function to do this.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello
I am trying to add a combo box to a datagridview, using the code below. However, i get the following error message: "Object reference not set to an instance of an object."
I also get this repeated message every few seconds. "The following exception occurred in the datagridview:
system.argumentException: Datagridviewcomboboxcell value is not valid.
To replace this default dialog please handle the dataerror event"
I haven't added the combo to the datagridview at design time, only in the code below.
Try<br />
'Fill the datagrid<br />
Me.TA_OrderSoftwarePart_dsCodeRed1.Fill(Me.DsAddComponetAndEquipment.OrderSoftwarePart)<br />
Me.dgvOrderSoftwarePart.DataSource = Me.bsOrderSoftwarePart<br />
<br />
Dim dgvc As DataGridViewComboBoxColumn<br />
dgvc = Me.dgvOrderSoftwarePart.Columns("Status")<br />
<br />
dgvc.Items.Add("To be Ordered")<br />
dgvc.Items.Add("Ordered")<br />
dgvc.Items.Add("Delivered")<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.Message)<br />
End Try
Many thanks for any help with the code above,
Steve
|
|
|
|
|
I only had time for a quick look, but you created a reference to a POSSIBLE DataGridViewComboBoxColumn. You didn't actually create a new column. Change this line:
Dim dgvc As New DataGridViewComboBoxColumn
|
|
|
|
|
Hello,
I didn't use the new key word, as I don't want to create a new column but convert an existing column into a combo box column.
In my database table I have a column called status. This can be either "To be Ordered", "Ordered", or "Delivered".
So when datagridview displays in the form, it will allow the user to select either one of them.
Many thanks,
Steve
-- modified at 1:52 Wednesday 27th June, 2007
|
|
|
|
|
Well, that's where the "Object reference not set to an instance of an object" came from.
If I get your meaning, you can't change the type of the column once it's created. For example, you can't change a TextBoxColumn into a ComboBoxColumn. You can, however, hide the original TextBoxColumn, create an entirely new ComboBoxColumn, add it to the columns collection and setup it's properties to bind to the appropriate column in the dataset.
|
|
|
|
|
I've been trying to do the same thing. Could you post code for adding the ComboBoxColumn and binding it to the appropriate column in the dataset?
Thanks,
Diane Volk
|
|
|
|
|
Quick and dirty:
Dim col As New DataGridViewTextBoxColumn()
With col
.DataPropertyName = "Description"
.HeaderText = "Description"
End With
DataGridView1.Add(col)
|
|
|
|
|
This worked perfectly. I was missing setting the DataPropertyName in my code.
Thanks!
Diane Volk
|
|
|
|
|
Hello, I'm using Visual Basic 2005. I created html pages inside the webbrowser1 object. I added a text box and search button above the container. I would like the user to put in a word and click the search button to search for that word on the html pages, which are located in the webbrowser1 object container. Can this be done? Does anyone know how? Please help.
|
|
|
|
|
Of course it's possible.
One question - What do you mean by "webbrowser1 object container"? HTML files are just text files stored on the hard drive.
|
|
|
|
|
I typed all my help documentation inside of this webbrowser1. I placed the webbrowser1 container on my form from the toolbox and then typed documentation and placed jpegs pics inside. I placed a textbox and a button at the top of this form (they are not part of the container) and I want to be able to type a word in the textbox, that's in the HTML document and hit the button to take me right to where this word is in the document. How do I search the html document?
|
|
|
|
|
this is the code i have thus far. It works..I just want it to highlight in the document.
Dim selStart As Integer
Dim seekString As String = tbSearch.Text.ToString
Dim textStart As Integer
textStart = tbSearch.Text.IndexOf(seekString)
If textStart > 0 Then
tbSearch.SelectionStart = selStart - 1
tbSearch.SelectionLength = seekString.Length
End If
tbSearch.ScrollToCaret()
|
|
|
|
|
Pardon me, but if you look in the toolbox of visual studio 2005 towards the bottom under COMMON CONTROLS and ALL WINDOWS FORMS, there's a object called webbrowser. It enables users to browse web pages inside your form. Take a look! This is a windows application.
|
|
|
|
|
I know precisely what the WebBrowser control is and how it works. What you said you did just isn't possible using THAT control. You cannot type in it at all!
|
|
|
|
|
ROTFL - as a rule, when someone starts replying to themself in the questions forums, it's generally a sign of trouble ahead.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
So true!
|
|
|
|
|
My BAD..You're right. I just thought about it. Anyway, I have that control and I added HTML pages to the project and these pages display in the webbrowser control. I would to do searches on the pages that would highlight the word I searched on in the document.
I was extremely tired yesterday.....
|
|
|
|
|
wpoopsi wrote: I typed all my help documentation inside of this webbrowser1
No you didn't. A WebBrowser control doesn't allow you to type anything inside it. You used something else. Did you possibly create a Web Forms (ASP.NET) application??
|
|
|
|
|
is it possible to show messagebox in windows service
is it possible to show any User Interface?
thanks
Nachi
|
|
|
|
|
In Services under Computer Management, select your services and in its property sheet, in the "Log On" tab, check "Allow service to interact with desktop"
|
|
|
|
|
In a Web Service? No, there is no user interface possible at all. You cannot show any kind of a message box.
|
|
|
|
|
?? He said a *windows* service, didn't he ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Jeez! What's wrong with me!? I could have sworn he said Web Service!
|
|
|
|
|
I found it funny, b/c the person who answered the question, got a 1, and you got a 5 vote :P
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yeah, I saw. That's goofy. I guess it's a step to balance out the "UniVoters" areound the site.
|
|
|
|