|
Hi every body ,
i have a problem ??
i have a list view control in windows application , and i set its chcek property to true
i want if the user Check an item to make all other items unchecek and i don't know how ? i try too much but it doesnot work
Can You help me how to do it ??
Thanks
Mona .
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
You'd have to handle the ItemChecked event of the ListView, which will give you the item that was clicked on. You'd then have to set a static flag in the event handler that will signal that you are changing check marks. Iterate over the items in the list, changing each check mark, then reset the flag. Since changing the check mark will fire the same event again, the handler code has to start by check that flag. If it's set, then the handler code can exit without making any changes.
But, wouldn't this be a job for RadioButtons?? After all, this is exactly what they do.
|
|
|
|
|
thanks for your replay
but can you mak it more simple , sorry i am new in vb so can u explain with code , it'll be better and easy to understand
Thanks a lot
Mona
LA ELAH ELA ALLAH MOHAMED RASOL ALLAH
|
|
|
|
|
Hello,
Please try this code. I believe this should assist you.
<br />
Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck<br />
<br />
For i As Integer = 0 To Me.ListView1.Items.Count - 1<br />
<br />
If i <> e.Index Then<br />
<br />
Me.ListView1.Items(i).Checked = False<br />
<br />
End If<br />
<br />
Next<br />
<br />
End Sub<br />
<br />
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
or another one
<br />
If Bloading the exit sub<br />
bLoading = true<br />
For each oItem as Listview item in LVData.items<br />
oitem.checked = true<br />
next<br />
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
sorry for my english...jejeje
i can't create my UserControl With opacity.
somebody knows like doing it?
I thank for your aid....
CODEPROJECT is my favorite WebSite.
thanks!!!
OrLaNdO HeRReRa
«« MEXICO »»
|
|
|
|
|
rammsteinohr wrote: i can't create my UserControl With opacity.
No, you can't. Opacity only applies to the entire form, not controls. Currently, you'd have to use WPF to do this.
|
|
|
|
|
I am developing in VS2008 Express Edition using ASP.net and VB.net. I would like to record the local time when something happens in the application (say a button is pressed). If you use the Now() function, it returns the Servers time. I want the time on the local computer. I have searched high and low and am baffled this is not needed more often. There is practically no mention of it on the web. Any pointers would be appreciated.
Thanks,
Karl Tomecek
|
|
|
|
|
This question really belongs in the ASP.NET forum. It has nothing to do with VB.NET at all.
There is nothing that the browser sends to your ASP.NET code that will tell you what timezone the client is in. You'll probably have to use JavaScript code in the page to set a hidden field with the clients time when the form is submitted back to your server to get the client time, or at least the timezone the client is in. Your ASP.NET code would then have to parse the date time value found in the hidden field to get at this information.
|
|
|
|
|
I beleive it is available in the environment variables which can be got at via JS
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Does that also apply to JavaScript running in a browser on a *nix box??
|
|
|
|
|
I see what you mean, I may be thinking of the win env vars. Is there a equivalent to the var set in *nix is probably the relevant ?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I think it would be possible via the Javascript. First get the time via jscript and then submit the form.
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
Thanks for all your input. It helped me find a great website with a video that more or less shows you how to do this. In the end, it was done with Javascript storing the date in a hidden variable and then the app has access to that data. Here is the link in case anyone ever needs to learn how to do this:
http://www.asp.net/learn/videos/video-275.aspx
Thanks to you all once again...
Regards,
Karl
|
|
|
|
|
i'm having an major performance issue with a concatination query i wrote against a datatable and was looking for a way to either speed up the query or a whole nother way of doing it which performs better...
at present my app spends 2 min processing this one loop, while i can do the two loops individually in about 5 seconds.
Here is the code:
<code>
For Each dr As DataRow In Main.DS_New.Tables(RightTable).Select(filter, "location,type desc")
Dim CATValues As String = Nothing
If dr.RowState <> DataRowState.Deleted And dr.RowState <> DataRowState.Detached Then
Select Case dr("name").ToString.ToLower
Case "value"
For Each DRsameLocation As DataRow In Main.DS_New.Tables(RightTable).Select(filter & " AND PK<>" & dr("PK") & " AND Location='" & dr("Location") & "' AND type='" & dr("type") & "' AND Name='" & dr("Name") & "'")
CATValues += Chr(215) & DRsameLocation("loc") & Chr(214) & DRsameLocation("value")
DRsameLocation.Delete()
Next
If CATValues = Nothing Then
dr("value") = dr("loc") & Chr(214) & dr("value")
Else
dr("value") = dr("loc") & Chr(214) & dr("value") & CATValues
dr("loc") = "MV"
End If
End Select
End If
Next
</code>
|
|
|
|
|
This would probably be better done on the database side with a stored procedure. Look into the COALESCE sql function.
|
|
|
|
|
unfortunatly since the data is in a datatable, and not in SQL, that is not an option.
|
|
|
|
|
Can someone tell me if I have to end up w/ my mail merge template open when creating a new document. I don't want to spend a lot of time trying to figure out how to close it, if it's not possible. Thanks!
|
|
|
|
|
|
any chance you can send me how you did the mail merge? i've been fighting with a way to get it to work where i process the mailmerge from a dataset...
|
|
|
|
|
Hello,
I have attached a VB program done in VB 2008 which adds annotations to an Acrobat PDF file specified by the user. So far, it works like a champ. However, my ultimate goal is to build a VB 2008 application that inserts metadata into the "Title", "Author", "Subject" and "Keywords" fields that are accessible from the Description tab of the Document Properties dialog box on the Acrobat "File" menu. I can do this in Acrobat's built-in JavaScript debugger just fine. For instance, the following will insert Harry Wishes into the author field.
this.info.author = "Harry Wishes"
My question: How do I invoke the Javascript object from Visual Basic 2008 that could access and modify this PDF metadata from Visual Basic? Help Apprectiated. Thanks!
Public Class Form1
Dim gApp As Acrobat.CAcroApp
<p>
Private Sub Form1_Load()
gApp = CreateObject("AcroExch.App")
End Sub
<p>
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pdDoc As Acrobat.CAcroPDDoc
Dim page As Acrobat.CAcroPDPage
Dim jso As Object
Dim path As String
Dim point(1) As Integer
Dim popupRect(3) As Integer
Dim pageRect As Object
Dim annot As Object
Dim props As Object
<p>
OpenFileDialog1.ShowDialog()
path = OpenFileDialog1.FileName
pdDoc = CreateObject("AcroExch.PDDoc")
If pdDoc.Open(path) Then
jso = pdDoc.GetJSObject
If Not jso Is Nothing Then
' Get size for page 0 and setup arrays
page = pdDoc.AcquirePage(0)
pageRect = page.GetSize
point(0) = 0
point(1) = pageRect.y
popupRect(0) = 0
popupRect(1) = pageRect.y - 100
popupRect(2) = 200
popupRect(3) = pageRect.y
' Create a new text annot
annot = jso.AddAnnot
props = annot.getProps
props.Type = "Text"
annot.setProps(props)
' Fill in a few fields
props = annot.getProps
props.page = 1
props.point = point
props.popupRect = popupRect
props.author = "Rob McAfee"
props.noteIcon = "Comment"
props.strokeColor = jso.Color.red
props.Contents = "I added this comment from Visual Basic!"
annot.setProps(props)
pdDoc.Close()
MsgBox("Annotation added to " & path)
Else
MsgBox("Failed to open " & path)
End If
End If
pdDoc = Nothing
End Sub
<p>
End Class</p></p></p></p>
|
|
|
|
|
That's going to be a function of the PDF Library you're using, if it's exposed at all. Without the documentation on that library, your next bet is to use the Object Browser window (F2 in Visual Studio) to explore the libraries object model, looking for some methods and/or properties that might do this for you.
|
|
|
|
|
Dear Sir,
I have a string object in vb.net 2005
like
Dim str as string
str=chr(14) & chr(27) & chr(72) & "My Name Is Bishu" & chr(20)
How I send it to printer through vb.net 2005 code
which print according to printer setting
massenger code
|
|
|
|
|
What you need is the ability to send raw data to the printer. This[^] is an example of what you're looking for.
|
|
|
|
|
how to capture hidden control and save in bmp format
|
|
|
|