|
Show the code like Dave recommended.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I have a Word document I would like to use as an about screen in my application. How can I show this document, while keeping all the formatting, inside my application?
|
|
|
|
|
A Word document is way too heavy for an About box and would require that every use who uses your app have Word installed just to see your About box. A lighter, though still pretty heavy IMHO, alternative is to export the document as an HTML file and use the WebBrowser component in the Toolbox to display it.
|
|
|
|
|
I tried using the WebBrowser component but it seems I have to hard code the entire physical path to the html file. This does not work well when installing on another computer. Do you have any good examples for this component? Thanks.
|
|
|
|
|
dptalt wrote: I have to hard code the entire physical path to the html file.
No, you don't. Lookup Application.StartupPath .
Dim fullPath As String = Path.Combine(Application.StartupPath, "help.html")
|
|
|
|
|
Thanks Dave, I will try it.
|
|
|
|
|
hi my frnds,
i'm doing a vb.net windows application. here i hve a multiple entry form. is there any flex grid like vb in vb.net. how can i use it. i really fedup by searching the same..
please... please.. please....
|
|
|
|
|
if you would rather deal with flex grid you can put the grid in the vb.net project (interopt). otherwise the dategrid is the one that vb.net offers...(doesn't offer same features out of the box).
|
|
|
|
|
can i use tat for the multiple entry
|
|
|
|
|
can i use te datagrid for the multiple entry
|
|
|
|
|
forgive but - 'multiple entry' means what? multiple tables in the same grid? - i don't know...never tried.
|
|
|
|
|
hi all
how can i add all fonts in a combobox
i have tried
combobox1.items.addrange(fontfamily.families)
but it fills the combo with
FontFamily : Name=Arial
and so on ....
|
|
|
|
|
System.font & add loop.....
Do this & reply me dear.....
TO develop project in C,C++ , VB6,vb.net.....
|
|
|
|
|
hi
i need to load all font size in the combo
thnx
|
|
|
|
|
Hi,
FontFamily.GetFamilies() returns an array of type FontFamily
that class has a Name property.
it also has a ToString() method but that is not guaranteed to return the name
that you want !
|
|
|
|
|
You'll have to wait for the user to pick the font, then repopulate a size combobox depending on the font. Not all fonts are the same. Some are bitmap fonts that have various sizes built into the file they come from, others are like TrueType fonts that are outline fonts and are only stored in the font file in one or two sizes. Those outlines are then scaled to any size the user wishes.
|
|
|
|
|
Alternativly just use the FontDialog provided in the System.Windows.Forms namespace to let the user select the font, size, style and everything. That way all the hard work is done for you by Microsoft.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
|
|
|
|
|
i already try it but the requirments are little bit different i must fill the combo with fontname, other combo with fontsize, other combo with fontstyle and these combo are on a toolstrip.
thnx
|
|
|
|
|
i am writing a program where the user enters data into a windows form
and then saves that data to a database, i then want the user to click
a button that sends an email to there department manager with a summary
of the data entered.
the question is what would be the best way to approach this? i was
thinking of either producing a report and sending that as an attachment
or somehow have the data entered in to the body of the email.
any suggestions please
|
|
|
|
|
IETaxguard wrote: the question is what would be the best way to approach this? i was
thinking of either producing a report and sending that as an attachment
or somehow have the data entered in to the body of the email.
That's entirely up to you. It depends on what the use wants to see. If they want to see a report, you can pick whatever format you want for it, that exports a file anyway, like PDF, and use one of the publicly available PDF writersto print to a file and attach it to the email, or you can send it as formatted text in the body of the email. It's entirely up to you.
I personally, like to see nice emails with a report...
|
|
|
|
|
I am trying to insert record into and SQL Server 2000 database and I keep getting the following error:
Cannot insert the value NULL into column 'ItemID', table 'RAM.dbo.Item_JS'; column does not allow nulls. INSERT fails.
The statement has been terminated.
The column ItemID is set to autonumber in the db. Here is my code:
Dim myConnString As String = "Data Source=********;Initial Catalog=******;User ID=*****;Password=*****;"<br />
<br />
Dim myInsertQuery As String = "INSERT INTO Item_JS (ItemPartNumber, ItemSourceCode, ItemSupercede, ItemCost, ItemName, ItemListPrice, ItemLastUpdateDT, ItemStatus, ItemCreationDt, CompanyID, StoreID, BrandID, PackageID) VALUES('" & Trim(partnumber) & "', '" & Trim(sourcecode) & "', '" & Trim(supercede) & "', CONVERT(MONEY,'" & cost & "'), '" & Trim(itemname) & "', CONVERT(MONEY,'" & listprice & "'), '" & Trim(lastupdateDt) & "', '" & Trim(status) & "', '" & Trim(insertdate) & "', '" & Trim(companyID) & "', '" & Trim(storeID) & "', '" & Trim(brandID) & "', '" & Trim(packageID) & "'" & ")"<br />
<br />
Dim myConnection As New SqlConnection(myConnString)<br />
myConnection.Open()<br />
Dim myCommand As New SqlCommand(myInsertQuery, myConnection)<br />
myCommand.ExecuteNonQuery()<br />
myConnection.Close()
Any Ideas?
jds1207
|
|
|
|
|
Have you tried inserting a value in the ItemID field? It is supposed to autonumber, but, from your comments, it doesn't appear to.
For what its worth, I DETEST autonumber... it has and is causing me to get heartburn... rather than autonumber, use a transaction or something to get the last value used and increment it for your insert.
Tim
|
|
|
|
|
Am using vb.net 2003, i was used to the drag and drop style of adding adapter's in my project, now am going down to code everything, when i create a data, adapter, i code them behind. before when i drag and drop the adapter in the form, i could call that adapter in my Button. i have the Following code that i have wrote in my form load
Dim strconnection As String = "workstation id=5875-049;packet size=4096;user id= sde; Password=topology;data source= SGIICORNETGS01;persist security info=False;initial catalog=Tshwane_Valuations"
Dim cn As SqlConnection = New SqlConnection(strconnection)
cn.Open()
'set up data adapter
Dim strSql As String = _
"select Actual_Extent,Attrib_code,Lis_key,Func_key,Density," _
& "New_Net_Usable_Extent,New_Total_Land_Factor,New_AdJ_Extent_1,New_Points_1," _
& "New_ADJ_Extent_2, New_Points_2, LS_Prediction, LS_Confidence,LS_TYPE from Property_Mass "
Dim da As SqlDataAdapter = New SqlDataAdapter(strSql, cn)
'load the Data set
Dim ds As DataSet = New DataSet
da.Fill(ds, "Property_Mass")
'set up data Adapter Object
Dim strErrorMsg As String
Dim strerror As System.Data.SqlClient.SqlError
'set up the data soruce
strSql = _
"select Property_Mass.Actual_Extent,Property_Mass.Attrib_code,Property_Mass.Lis_key,Property_Mass.Func_key,Property_Mass.Density," _
& " Property_Mass.New_Net_Usable_Extent,Property_Mass.New_Total_Land_Factor,Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1," _
& " Property_Mass.New_ADJ_Extent_2, Property_Mass.New_Points_2, Property_Mass.LS_Prediction, Property_Mass.LS_Confidence, Property_Mass.LS_TYPE," _
& " Property_Summary.Purchase_Date, Property_Summary.Purchase_Price" _
& " from Property_Mass, Property_Summary" _
& " where Property_Mass.Lis_key = Property_Summary.Lis_key"
da = New SqlDataAdapter(strSql, cn)
'load a Dataset
Try
da.Fill(ds, "Property_Summary")
' BindingSource(bindingSource = New BindingSource)
'Close the Connection
cn.Close()
'Create relations
ds.Relations.Add("Property_summary_Mass", _
ds.Tables("Property_Mass").Columns("Lis_key"), _
ds.Tables("Property_Summary").Columns("Lis_key"))
'Bind the data set to the grid.
'Assumes that Grid contains a reference to a
'system.windows.datagrid
DataGrid2.SetDataBinding(ds, "Property_Mass")
'sorting the Datagrid
DataGrid2.AllowSorting = True
Catch ExSQL As System.Data.SqlClient.SqlException
'''All this will trap all data Problems and Network if available
For Each strerror In ExSQL.Errors
Next
Select Case strerror.Number
Case 17
strErrorMsg = "Missing server"
Case 4060
strErrorMsg = "Missing database"
Case 18456
strErrorMsg = "Missing user name or password"
Case Else
strErrorMsg = strerror.Message
End Select
MessageBox.Show(strErrorMsg, "SQL Server Error: " & strerror.Number, MessageBoxButtons.OK, MessageBoxIcon.Error)
Catch ExcpInvOp As System.InvalidOperationException
MessageBox.Show("Close the connection first!", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Error)
Catch Excp As System.Exception ' generic exception handler
MessageBox.Show(Excp.Message, "Unexpected Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
This code is working well and it display my dataset results on load. So i have included a Button to Search for a certain Column,but now when i try to use "da" which is the adapter declared in Form load,trying to access it from the button i have placed in my form. it complains about declaration. i understand everything in a form load is Private and the buitton itself is private,
1) how can i declare the adapter and the connection objects to be on the same scope when you drag and drop them on the form?
2)And from my search, am searching from a Field that has (## ## ## ## ##) numbers in a string Field, and i have to rearch by retrieving the first four,i can do that in SQL by using substring, tell me how can i achieve this and display the data in the datagrid.?
Vuyiswa Maseko
|
|
|
|
|
The scope as you've written the code, is the life of the Form_Load sub. Anything you Dim in the Sub is destroyed when execution leaves the Sub.
Vuyiswamb wrote: 1) how can i declare the adapter and the connection objects to be on the same scope when you drag and drop them on the form?
You can't. Their code is created in different places.
Vuyiswamb wrote: 2)And from my search, am searching from a Field that has (## ## ## ## ##) numbers in a string Field, and i have to rearch by retrieving the first four,i can do that in SQL by using substring, tell me how can i achieve this and display the data in the datagrid.?
I think you're asking about what the SQL SELECT would look like??
SELECT columns FROM table WHERE someColumn LIKE @Pattern
In your code, you'd add a SqlParameter object, with the parameters name @Pattern to the SqlCommand object this SQL is in and set it's value to something like "39 49 20 10 %". THe percent sign is the "wildcard" and will match anything else after the initial string.
|
|
|
|
|
hi all
i need to move the toolbar on the form
will some one let me know how to do that
thnx
|
|
|
|
|