|
if i have list view as :
dim i1 as listviewitem
if k=1
i1=new listviewitem("hi")
else
i1=new listviewitem("hi")
end if
listview1.item.add(i1)
i need in the case (1) if k=1 add to listview hi as red color
but if k<> 1 add it to listview1 hi as blue
could you help me?
kilany
|
|
|
|
|
hi,
if k=1<br />
i1=new listviewitem("hi")<br />
i1.forecolor=color.red<br />
else <br />
i1=new listviewitem("hi")<br />
i1.forecolor=color.blue<br />
end if <br />
listview1.item.add(i1)
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
Strange question my friend...Strings are no more than a collection of characters, String Data Type do not have format. Display format is applied in visual controls like Labels, TextBoxes, RTFs.... Try creating a new Font object and setting it in the Font property of the visual control. Also, you can edit the font properties of the control in the VS .NET Designer
-----------------
Solo hay 10 tipos de personas, las que saben binario y las que no
|
|
|
|
|
Hellow to all ,
i am exporting a report to PDF Format when i open it in Acrobat 7 i got the report mixed and missing data , but when i open it in Acrobat 5 , i can read it in a right way ...
|
|
|
|
|
I am handling a large-scale project entitled as MIS (Marketing information System). I am using Vb 6 as front end, Ms Access as back end and Crystal report 8 as reporting tool.
1) In the project i am required to save customers image to database, and it should be shown in individual customer’s report, which will include that image. I had taken OLE field in the database to save images. I had taken Common dialog box control to select image and display it in OLE control, but i don't know how to save the OLE controls image to database. i am using ADO object to access the database. How could I can save and retrieve the image from database? Is it possible to save images by using other controls like Picture box or image control in the form? I want to save image as bitmap in the database.
2) The size of project is very large then it is useful to store image to database? Will it make it slower to access database?
3) Saving path of image in database will make any difference? If i do so then how can show the images in report (Crystal
report 8)?
Kiran Sajanikar
Software Engineer
CleverBIT softwares.
Pune.
|
|
|
|
|
pls find this url
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvbpj01/html/gs0102.asp
it's helpful for u
Parwej Ahamad
|
|
|
|
|
I have access to a program, in which all of the text editing is done through table fields.
However the Delete key doesnt delete text. Only the backspace key will delete text.
Also, Ctrl-C/CtrlV is spotty at best.
Any ideas as to how I can fix this?
Just a note but while this is an application I'm using, I have access to the source code, so I can change it if I need to.
From the looks of it, the controls used are PropertyGrids and DataGrids.
- Munty
|
|
|
|
|
Which version of VB of you using?
Does the code handle any of the DataGrid's Key events, KeyDown, KeyUp, KeyPress? Ctrl-C/V is spotty because in most cases you selected the cell, not the text inside it. A DataGrid does NOT work like an Excel spreadsheet, so don't expect the same functionality as far as keyboard handling.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I can't see any handling in the code. (The only handling I've found is one for any changes (adds to undo stact), and some value updaters depending on what you put into a specific field.)
Function wise, the cells handle like something from Access.
The version of VB is whichever version comes with Visual Studio 2005
- Munty
|
|
|
|
|
From the looks of it, VB.NET.
- Munty
|
|
|
|
|
Make sure there are no toolbar buttons that have a shortcut key of "Del" or "Delete" that are eating the keystroke but not doing the right action with it.
Watch for a telltale flicker when you hit the delete key.
|
|
|
|
|
Before I start: Thanks for the comment. I think it's shown me where the problem is. I just don't know how to fix it :P
Trying out the del key in the program produces no flicker, however I looked at the menus in the source code and it looks like the Delete option in the Edit menu uses the Del shortcut.
However, when that shortcut is removed, the delete key no longer works on the nodes in the TreeView. From the looks of it, when that menu is used, if the Treeview is the active frame, it removes whatever node is selected.
I assume to fix the problem, I just change it so that it has an else statement that makes the delete key act like normal. I just don't know how to do that.
- Munty
|
|
|
|
|
Well never mind. Now that I know the problem area was the menu, I was able to get a fix.
The fix wasn't adding an else to the delete statement. It was adding a handler to the FixtureTree that listened for the delete key, then called the appropriate handlers when del was pressed.
- Munty
|
|
|
|
|
Excellent. Glad I could help.
Dave
|
|
|
|
|
Hai VB'ers...
I have problems in using/implementation NERO SDK with VB codes.
My problem is:
1. How to calculate disk space in CD?
2. How to make multisession burn process?
Thxs b4...
Regrads,
Harry
|
|
|
|
|
These are questions about the library you're using, not VB. Your best source of information is going to be a Nero support board.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi all
I am creating a crystal report and the Problem is that when i debug the same program i get my Result But when i didnot debug and execute directly i am not getting required result.
!!kindly Help me. Where is the Problem
I have written my code.
Dim SqlStr As String
SqlStr = " Select * from tmp"
Set Rs1 = Db.OpenRecordset(SqlStr, dbOpenDynaset)
If Rs1.RecordCount <> 0 Then
Do While Rs1.EOF <> True
Rs1.Delete
Rs1.MoveNext
Loop
End If
Set Rs1 = Nothing
SqlStr = "SELECT SalesMaster.`INvcNo`, SalesTrans.`Item`, SalesTrans.`Company`, SalesTrans.`Design`, SalesTrans.`Shade`, SalesTrans.`Qty`, SalesTrans.`MRP`, SalesTrans.`DicsAmt`, SalesTrans.`Amount`" & _
" From `SalesMaster` SalesMaster INNER JOIN `SalesTrans` SalesTrans ON " & _
" SalesMaster.`INvcNo` = SalesTrans.`InvcNo`" & _
" Where SalesMaster.`INvcNo` = " & txtInvoice.Text
Set Rs1 = Db.OpenRecordset(SqlStr, dbOpenDynaset)
SqlStr = "Select * from tmp"
Set Rs2 = Db.OpenRecordset(SqlStr, dbOpenDynaset)
If Rs2.RecordCount <> 0 Then
Rs2.Edit
ItmStatus = "M"
Else
ItmStatus = "N"
Do While Rs1.EOF <> True
Rs2.AddNew
Rs2!INvcNo = Rs1!INvcNo
Rs2!Item = Rs1!Item
Rs2!Company = Rs1!Company
Rs2!Design = Rs1!Design
Rs2!Shade = Rs1!Shade
Rs2!Qty = Rs1!Qty
Rs2!MRP = Rs1!MRP
Rs2!DicsAmt = Rs1!DicsAmt
Rs2!Receiptno = ""
Rs2!Type = "Invoice Detail"
Rs2!Amount = Rs1!Amount
Rs2.Update
Rs1.MoveNext
Loop
End If
Set Rs1 = Nothing
SqlStr = " SELECT SalesMaster.`INvcNo`, Receiptmast.`Receiptno`, Receiptmast.`RAmount`, Receiptmast.`Party`, Receiptmast.`RDate` " & _
" From `SalesMaster` SalesMaster INNER JOIN `Receiptmast` Receiptmast ON " & _
" SalesMaster.`INvcNo` = Receiptmast.`InvoiceNo` " & _
" where SalesMaster.`INvcNo` = " & txtInvoice.Text
Dim sum As Single
Set Rs1 = Db.OpenRecordset(SqlStr, dbOpenSnapshot)
Do While Rs1.EOF <> True
Rs2.AddNew
Rs2!INvcNo = Rs1!INvcNo
Rs2!Item = ""
Rs2!Company = ""
Rs2!Design = ""
Rs2!Shade = ""
Rs2!Qty = ""
Rs2!MRP = ""
Rs2!DicsAmt = ""
Rs2!Receiptno = Rs1!Receiptno
Rs2!Type = "Recipt"
Rs2!Amount = Rs1!RAmount
sum = sum + Rs1!RAmount
Rs2.Update
Rs1.MoveNext
Loop
SqlStr = " SELECT " & _
"SalesMaster.`INvcNo`, SalesMaster.`Date`, SalesMaster.`TotAmt`, SalesMaster.`VAT`, SalesMaster.`Gtotal`, " & _
"tmp.`Item`, tmp.`Company`, tmp.`Design`, tmp.`Shade`, tmp.`Qty`, tmp.`MRP`, tmp.`Type`, tmp.`Receiptno`, tmp.`Amount`" & _
"From" & _
"`SalesMaster` SalesMaster INNER JOIN `tmp` tmp ON " & _
"SalesMaster.`INvcNo` = tmp.`INvcNo`" & _
"where SalesMaster.`INvcNo`=" & txtInvoice.Text
CrystalReport1.SQLQuery = SqlStr
CrystalReport1.Formulas(0) = "Party_name = '" & TxtParty.Text & "' "
CrystalReport1.WindowWidth = 5000
CrystalReport1.Formulas(1) = "Start_dt = '" & Format(DTPickerS, "dd/mmm/yy") & "' "
CrystalReport1.Formulas(2) = "End_dt = '" & Format(DTPickerE, "dd/mmm/yy") & "' "
CrystalReport1.Formulas(3) = "Today_dt = '" & Format(DTPickerT, "dd/mmm/yy") & "' "
CrystalReport1.Formulas(4) = "Invoice_no = '" & txtInvoice.Text & "' "
CrystalReport1.Formulas(5) = "Sum_Receipt = '" & sum & "' "
CrystalReport1.ReportFileName = App.Path & "\Reports\tmp.rpt"
CrystalReport1.Action = 1
Withe Regards
Alok Singh
|
|
|
|
|
It's impossible to tell you what's wrong if we don't know what the result is supposed to be and what the code is actually doing!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i met up with "conversion from type 'DBNull' to type 'String' is not valid" error when i am doing my project. My code are as follows hope someone could help.
Try
Dim strSelected As String
Dim strShutdownTime As String = DTPickerStartDate.Text + " " + DTPickerTime.Text
Dim sqlStr As String = ("Select * from EventTable")
Dim dTable As DataTable
Dim db As New DBController
Dim flagInsert As Boolean = True
Dim strActionName1 As String = ""
'Dim strActionName As String = TxtActionName.Text
dTable = New DataTable()
db.Connect("PCMgr.mdb")
db.retrieveDTable(sqlStr, dTable)
Dim TReader As DataTableReader
TReader = New DataTableReader(dTable)
If RadDaily.Checked Then
strSelected = RadDaily.Text
End If
If RadWeekly.Checked Then
strSelected = RadWeekly.Text
End If
If RadMonthly.Checked Then
strSelected = RadMonthly.Text
End If
If RadSpecial.Checked Then
strSelected = RadSpecial.Text
End If
While TReader.Read
flagInsert = False
strActionName1 = dTable.Rows(0)("ActionName")
If strActionName1 = TxtActionName.Text Then
db.Connect("PCMgr.mdb")
db.InsertRecord("UPDATE EventTable" + " set NextActionDateAndTime='" + strShutdownTime.Trim + "' where strTimeDo='" + DTPickerTime.Text + "'")
db.Close()
Else
db.Connect("PCMgr.mdb")
db.InsertRecord("Insert into EventTable" + "(TargetGroup, ActionDone,TimeDo, StartDate, NextActionDateAndTime, Frequency, Status, EndDate, ActionName) values ('" + CboChoices.Text + "','" + CboType.Text + "','" + DTPickerTime.Text + "','" + DTPickerStartDate.Text + "','" + strShutdownTime.Trim + "','" + strSelected.Trim + "','" + "Running" + "','" + DTPickerEndDate.Text + "','" + TxtActionName.Text + "')")
db.Close()
End If
If flagInsert = True Then
db.Connect("PCMgr.mdb")
db.InsertRecord("Insert into EventTable" + "(TargetGroup, ActionDone,TimeDo, StartDate, NextActionDateAndTime) values ('" + CboChoices.Text + "','" + strSelected.Trim + "','" + DTPickerTime.Text + "','" + DTPickerStartDate.Text + "','" + strShutdownTime.Trim + "')")
db.Close()
End If
End While
'TimerShutDown.Enabled = True
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
|
|
|
|
|
First up, remove the Try Catch. That will allow you to find out exactly which line is giving error. 9/10 it is complaining about some text field in being passed a null when trying to prefix and suffix a "'" to it.
Check for all the text fields marked as Not Null in the DB using String.IsEmptOrNull.
Hope this helps.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
thanks for the advise but i am still blur. i know is tis line "strActionName1 = dTable.Rows(0)("ActionName")" which is the cause of the error but i do not know how to debug the error.My DB is empty for the start and i am not suppose to hardcode any data into the DB. but after it is use once i need to check if the record exist so there wont be any repeat record and so i cant use insect only. Any idea in what i can do to debug tis error?
|
|
|
|
|
Subjugate wrote: "strActionName1 = dTable.Rows(0)("ActionName")"
I may not be able to advise you how to debug it since I dont know where the code resides, the general architecture etc.
However, you can test dTable.Rows(0)("ActionName") for DBNull by
IsDBNull(dTable.Rows(0)("ActionName")), if it is, assign
strActionName1 = ""
Please note that it is always good to assume that anything coming from the DB maybe null.
Hope this helps.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
i tried using IsDBNull(dTable.Rows(0)("ActionName")) but the ans is false and i oso tried to assign strActionName1 = "" but it just pop out the same error. So confused dun know where is the fault.
|
|
|
|
|
Can we see the entire code?
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
the entire code of the button i already paste it on the 1st forum already.. or wat entire code u referring to?
|
|
|
|
|