|
I am not sure if a direct solution exist. You can create an empty imageList and set its height to what you want and add that imageList to the SmallImageList . We had to use this solution in our previous project, we couldn't come up with a way to do this and we never bothered to research further as this fixed it.
|
|
|
|
|
Thankyou T.R. That makes sense, I will give this a try.
|
|
|
|
|
Hi
I have a DataGrid on a Windows form and want to export the data of Datagrids to an Excel worksheet.
I'm beginner to VB.NET programming. I'd appreciate if somebody can help me.
hprasain
|
|
|
|
|
0.Add Excel Object Library 11 Refrence to your project which is a COM
1. Instatiate an Excel application:
dim xlApp as new Excel.Application
2.define an Excel worksheet
dim xlWRK as Excel.Worksheet
3.define an Excel workbook
dim xlWBK as Excel.Workbook
4.Open a workbook in the instantiated application:
xlWBK=xlapp.workbooks.open("YourFile")
5.Get the sheet on the workbook
xlWRK=xlwbk.worksheets(0)
6.Get the value on the worksheet
dim value as string = xlwrk.cells(1,1).value()
Note:Indexes of cells wil begin from 1
Note:Call xlapp.quit when you do not need the application(it may remain in the memory)
Note:You can view the excel application by changing the visible property of xlapp to true(xlapp.visible=true)
A.E.K
|
|
|
|
|
Thanks a lot!
To make your code work well I have to make a change on xlWRK=xlwbk.worksheets(0)
to xlWRK=xlwbk.worksheets(1).
Once more thanks a lot!!
|
|
|
|
|
I am trying to get a contextmenu to show when I right click on a datagrid.
This works fine as long as there is no text selected on the grid I am clicking; however as soon as there is any text selected in the part of the grid I right click - I get the usual undo, cut, copy, paste, delete, select all contextmenu - which I do not want.
I even set a break point in the sub below and I noticed that if any text is selected and the right mouse button is clicked the sub is not entered.
Can someone help me with this please?
Guy
Private Sub onmyDataGridMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseDown
Dim LocalMousePosition As Point
If e.Button = MouseButtons.Right Then
LocalMousePosition = DataGrid1.PointToClient(Cursor.Position)
ContextHandler("GridMenu")
DataGrid1.ContextMenu.Show(DataGrid1, New Point(LocalMousePosition.X,
LocalMousePosition.Y))
End If
End Sub
You always pass failure on the way to success.
|
|
|
|
|
your DataGridView may have mouse event for cells.
A.E.K
|
|
|
|
|
Ok Thanks.
The datagrid is a particulaly fiendish control.
The potential for it is enourmous yet Microsoft have made it diffucult to use.
You always pass failure on the way to success.
|
|
|
|
|
I have a string array. I want to run a query that will pull numerous paragraphs from a database.
the query works fine. I usually use string = rs.GetString, and then split the string on Chr(13) into a string array so I can loop through and place each array memeber into a combobox or listbox.
however, in this situation, there is no distinct delimiter to split on.
I was wondering, if I use recordset.GetRows, use that in a loop...if I could then use some property/sub routine within recordset so that I can place each result in a specific element in my array manually using a loop. Right now I have the following:
'all definitions aside'
rs.Open LSQL, cnn
rowCount = rs.GetRows
For i = 0 To i < rowcount
paragraphArray(i) = rs.?????
I want to put basically the first recordset result into paragraphArray(0), second into paragraphArray(1), and so on until the recordset is at the end. I'm not sure of the exact code to use. Any ideas?
|
|
|
|
|
Hi reegan41,
I think you should store all fields value from recordset into string variable.
You can do this by read all fields with For Each Statement.
GoodID
|
|
|
|
|
helllloooo frnds,
can any one tell me regular expression to validate the domain name
that is
www.codeproject.com
plzz help...me
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Just want to understand......you want a regular expression to see if the domain is a registered domain on the internet?
Tom Wright
tawright915@gmail.com
|
|
|
|
|
hello tom,
i want to validate a text box which should be accept only
"www.codeproject.com" type of string
thankx for your favorable reply..
regards,
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
the regexp would be:
www.codeproject.com
|
|
|
|
|
thankx for your favorable reply..
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
A regular expression for validating domain names as follows:-
^[a-zA-Z0-9]+([a-zA-Z0-9]\-\.]+)?\.(com|org|net|info|biz|co.uk|org.uk|net.uk|gov|gov.uk)$
But I prefer to use the following function, as I actually checks to see if the domain is hosted :-
Public Function IsWebAddressActive(ByVal URL As String) As Boolean<br />
Try<br />
Dim req As System.Net.HttpWebRequest<br />
Dim res As System.Net.HttpWebResponse<br />
<br />
req = System.Net.HttpWebRequest.Create(URL)<br />
'set the user agent <br />
'some site might brush you off if it is not set (to stop bots and scrapers) <br />
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"<br />
<br />
'get response from website<br />
res = req.GetResponse()<br />
res.Close()<br />
Return True<br />
Catch<br />
Return False<br />
End Try<br />
End Function
and to use it, you would call it as follows:-
Dim bIsWebSiteActive as boolean<br />
bIsWebSiteActive = IsWebAddressActive("http://www.codeproject.com")
which, hopefully with return True , or if the website is not online it would return False
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
thankx for your favorable reply..
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Hi,
I need to transfer data from MS-Access db to SQL server db. I am having the date/time field in MS-Access with format as "mm/dd/yyyy h:nn:ss AM/PM". Having the field in SQL server as datetime.
For eg, If I store current datetime - in MS-Access it will be like this "15/06/2007 7:07:17 PM", when i try to update it in SQL server it gives error as "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
How to solve this.
Rams.
Be simple and Be sample.
|
|
|
|
|
My guess is that SQL server is seeing 15/06/2007 as an American date i.e. the 6th day of the 15th month of 2007.
Check how you have your dates set up on SQL Server - are they set up as defaulting to mm/dd/yyyy?
Also how are you moving the data to SQL Server - DTS package, flat file, import wizard?
If you can let me know how you are transfering the data I can probably give you more specific help.
Regards
Guy
Cambridge UK
You always pass failure on the way to success.
-- modified at 12:04 Saturday 16th June, 2007
|
|
|
|
|
How can I use a stored procedure to return query results and populate a data grid control? I am using VB 6.0 and SQL 2005.
|
|
|
|
|
Same way as if you were not using a stored procedure.
Tom Wright
tawright915@gmail.com
|
|
|
|
|
Thanks for replying. If you can kindly provide me with some vb 6.0 code to achieve this goal. A parameter is passed to the stored procedure at runtime and records are retrieved by the stored procedure which then populates the grid.
|
|
|
|
|
If you created the stored procedure, then replace that stored procedure name instead of where you have put query in your code earlier.
Be simple and Be sample.
|
|
|
|
|
consider a StoredProc "TEST" with parameters a and b, both of string datatype.
call it like this..
Query = "TEST '"& value for a &"', '"& value for b &"'"
now execute the Query as you do with simple queries...
The name is Sandeep
|
|
|
|
|
hello frnds,
how can validate a URL using vb.net
means my textbox should accept only
http://www.codeproject.com
please help....
regards,
koolprasad20 03
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|