|
don't really know what you mean with 'shadowed' so it's possibly the same as what I'm going to say now (if so: sorry).
a checkbox (a standerd one so one in treeview normally too) has 3 'checkstate's: unchecked,checked and indeterminate.
In you're case (where super node A with subnodes x,y,z and x = selected) I would put super node A to indeterminate and adjust you're code to do the checks on the checkstate property and not on the checked property
after checkedstatechanged (or some other event (don't know it by heart)) of super node A
If A.checkstate = unchecked then
uncheck all subnodes
else
check all subnodes
end if
after checkedstatechanged (or some other event (don't know it by heart)) of supnode x
if x.checkstate = unchecked then
uncheck subnodes
see if other subnodes of super node are checked
if x.parent.nodes ... = checked
super node A.checkstate = indeterminate
else
super node A.checkstat = unchecked
end if
end if
hope this helps
it's a bit difficult to read (I know) but read it twice and you'll get the idea
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
Hi all,
I have a little bit of a problem that I really need to find a solution for. What I have made is a custom collection class(inherits from collectionbase and all that) which holds around 200000 objects(these are custom objects too).
The problem is when I need to sort this really big list of items, the program just locks up and takes forever to finish the sort(I haven't let it run the full way through yet because It runs the computer low on memory).
I have had a look around on the net for fast array sorting and have found a few good ones but the ones I find seem to only able to sort small arrays and still fall over when you hand them my item list.
Can anyone help me with this.
Thanks
Nathan
|
|
|
|
|
to solve the locking problem: use threads (do some reading on the subject if you've never worked with them before)
dim thr as new threading.thread
...
this will in no means make the sorting better or faster but at least you're programe will still be able to accept user input.
to solve (or at least try too) the memory problem look at you're code and check if you haven't forgotten to dispose of unused object. I was able to tweak one of my program's (that I wrote at the start of my academic carreer(long time ago )) to use 50% less memory just by cleaning everything up.
for the sorting problem I don't imidiatly have anything (sorry)
hope this helps
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
I have an application that uses a datagrid and links a dataview to this datagrid.
I have some 284,000 rows in the datagrid and a sort takes 3.5 seconds (which I consider to be a decent response time). I'm not sure what sort of speed you are looking for.
As a DBA I would suggest not sorting the data but rather building an index object and link this to your collection.
You can then sort the index instead of your collection.
You could build an arraylist that links to your collection.
Sort the arraylist(index) instead of the collection et voila...
Let me know if this is helpful or totally goofy...
You always pass failure on the way to success.
|
|
|
|
|
Thank you both for you input.
I had a bit of a play around with the datagrid and it does work well but this part of the program doesn't need to have a UI. I'm working with the index idea right now, seems to be working fine for what I need, still slow compared to the datagrid but no big deal. I have threaded it to so that the program dosn't lock up.
Thanks
|
|
|
|
|
Can i possibly put two tables on one gridview?how to navigate it? how can i connect it on SQL?tnx for the replies;)
-- modified at 3:00 Friday 7th September, 2007
|
|
|
|
|
|
how can i attach the powerpoint file .ppsx in vb.net
i want a path to show that file
plz send me accurate code
lucky
|
|
|
|
|
Lucky Sheikh wrote: how can i attach the powerpoint file .ppsx in vb.net
Attach it to what?
Lucky Sheikh wrote: i want a path to show that file
Show it where?
Lucky Sheikh wrote: plz send me accurate code
Please write accurate questions.
|
|
|
|
|
'its urgent' is a subject that is not asking for help from the codeproject community, users have a tendency to just ignore messages that say urgent. In the subject just use a general subject question.
Please clarify the question that you are asking.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi all,
I am using this code to redirect the console output continiuly
[code]
Dim clsProcess As New System.Diagnostics.Process()
clsProcess.StartInfo.UseShellExecute = False
clsProcess.StartInfo.RedirectStandardOutput = True
clsProcess.StartInfo.FileName = "ping"
clsProcess.StartInfo.Arguments = "127.0.0.1 -t"
clsProcess.Start()
While (clsProcess.HasExited = False)
Dim sLine As String = clsProcess.StandardOutput.ReadLine()
If (Not String.IsNullOrEmpty(sLine)) Then
Me.TextBox1.Text &= sLine & vbCrLf
End If
Dim sErrorLine As String = clsProcess.StandardError.ReadLine()
If (Not String.IsNullOrEmpty(sErrorLine)) Then
Me.TextBox1.Text &= sErrorLine & vbCrLf
End If
Application.DoEvents()
End While
[code]
This Code Not working Propertly.It some time omits the error output.
How can I solve this issue
Or Is there any other method avaliable to redirect the console output in realtime and close the window when the console closes
Thanks in Advance
Dana
|
|
|
|
|
danasegaranea wrote: Or Is there any other method avaliable to redirect the console output in realtime
In realtime?? Yes, but yor're code is nowhere close to being able to do that.
You'd have to setup asynchronous callbacks and use the BeginRead method for each stream you wanted to read.
First, if all you're doing is pinging a machine and reading the output, why don't you use the built in Ping command in VB.NET 2005?? Or are you looking to do this with some other command line app?
|
|
|
|
|
Hello,
I have some text that is manipulated in RichTextBox. I want to add the contents of RTB in a Word document. I have written the code, but, it doesn't insert any text. The code just adds 2 pages in the document, and asks for Save Dialog(is expected). Can anyone help me, where am i going wrong.
<br />
Dim wApp As New Word.Application<br />
Dim wDoc As Word.Document<br />
Dim wdPgBrk As Word.WdBreakType = Word.WdBreakType.wdPageBreak<br />
<br />
wApp.Visible = True<br />
Dim rtb As RichTextBox = New RichTextBox()<br />
<br />
' Create a new document<br />
wDoc = wApp.Documents.Add()<br />
<br />
Dim i As Integer<br />
For i = 0 To 2<br />
<br />
' Load file in RTB<br />
rtb.LoadFile("D:\ORG Coded DE\DEA 2\DEA 2\Templates\Sample1.rtf")<br />
<br />
' Make Changes in rtb text - Replacing some text<br />
<br />
' Assign rtb text to wDoc<br />
wDoc.Content.Text = rtb.Text<br />
<br />
' Insert a page break in the word document<br />
wDoc.Content.InsertBreak(wdPgBrk)<br />
Next<br />
wDoc.Save()<br />
<br />
wdPgBrk = Nothing<br />
rtb = Nothing<br />
wDoc = Nothing<br />
wApp = Nothing<br />
<br />
I want to copy the rtb contents with its format.
I would be glad if anyone can assist me.
Thanks
Terry
|
|
|
|
|
try this
<br />
Public Target As Object = temppath & "\temp.rtf"<br />
<br />
Dim format As Object = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatRTF<br />
<br />
'Changing the format of the document<br />
newApp.ActiveDocument.SaveAs(Target, format, Unknown, Unknown, Unknown, Unknown, _<br />
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, _<br />
Unknown, Unknown, Unknown, Unknown)<br />
<br />
' for closing the application<br />
newApp.Quit(Unknown, Unknown, Unknown)
if it works please let me know
help everyone
|
|
|
|
|
eyes, thanks for giving the info to save as an rtf file. I am looking for something more:
Insert contents of an RichTextBox into current page of the Document
Insert a Page Break
Loop up this procedure till required. I got the way to insert a page break, but not to insert contents.
Can you throw light on it, please! For more reference, please refer the code.
Thanks
Terry
|
|
|
|
|
have you tried the
newApp.ActiveDocument.merge()
help everyone
|
|
|
|
|
For doing merge, I will have to save the contents of RichTextBox in a file, & then merge that file in Document. Can't the other way out be worked. As this merge will increase 2 steps of my procedure. Additionally, I tried but, the following code gives me error
<br />
For i = 0 To 2<br />
<br />
' Load file in RTB<br />
rtb.LoadFile("\Sample1.rtf")<br />
<br />
' Make Changes in rtb text - Replacing some text<br />
rtb.AppendText("DOCUMENT " + i.ToString())<br />
rtb.SaveFile("\Sample1Temp.rtf") '*********** Error<br />
rtb.Clear()<br />
' Assign rtb text to wDoc<br />
wDoc.Content.Text = rtb.Text<br />
<br />
' Insert a page break in the word document<br />
wDoc.Content.InsertBreak(wdPgBrk)<br />
wDoc.Merge("\Sample1Temp.rtf")<br />
Next<br />
Once the For loop is executed, first time Sample1temp.rtf is merged in the WDoc object. Second time, on saving Sample1Temp.rtf, gives error "saying it is already in use with other process."
Thanks
Terry
|
|
|
|
|
Dear everyone...
i have problem that i have 10 listboxes onto my form.
i want to display a command button but it should be displayed along with the same listbox where i am present or where i am recently clicking.
so i need to store the active control name in a variable.
please tell me that how i can get current control name.
thanks
|
|
|
|
|
sorry to say that but i just can't understand your problem, can you please describe it more.
as much i think, you need a button when you select a listbox out of your 11 list boxes(am i right). make a button on runtime and make it show hide or set its visible property to true or false as per your need on given position. you have to add a handler to handle its events and don't forget to dispose the handler when you don't need it.
hope this help
help everyone
|
|
|
|
|
Try This:
Have a variable accessible to all subs.
Dim LastControl as Control
Then on each of the listboxes click event put this.
LastControl = sender
Then on the command button click:
LastControl should equal the listbox last clicked.
|
|
|
|
|
Why is that property AutoCompleteCustomSource of a TextBox wont work when you set its property as multiline?? and once you bring it back as non-multiline textbox then it works and show the AutoCompleteSource?
what if i want to use a textbox as multiline and to show autoCompleteSource once it TextChanged occur?
Please anybody there who can explain it to me briefly...
and if anyone have the idea how to do that???
Thanks... I appreciate to anyone who reply with me..
Thanks again...
|
|
|
|
|
please remove the double entry of your question.
help everyone
|
|
|
|
|
Not supported. I wouldn't expect a multiline TextBox to use AutoComplete.
Here's the problem with trying to do it: Are you trying to use AutoComplete on the entire contents of the multiline TextBox, or are you tryin to use it on each line of a multiLine TextBox??
|
|
|
|
|
In a previous program I was able to add the reference Microsoft.Office.Core
This enabled me to open Excel in the background using my VB.Net Program.
With the new program however when I go looking for the same reference I can only add...
Interop.Microsoft.Office.Core
I think this is the reason for my error
"'New' cannot be used on an interface."
My code looks like this
xlsApp = New Excel.Application<br />
xlsApp.Visible = False
If I try to bring the "Microsoft.Office.Core" across by adding a reference, it sees the "Microsoft.Office.Core" but imports it as "Interop.Microsoft.Office.Core".
Grateful for any helpful suggestions.
|
|
|
|
|
frankiebaby2 wrote: If I try to bring the "Microsoft.Office.Core" across by adding a reference, it sees the "Microsoft.Office.Core" but imports it as "Interop.Microsoft.Office.Core".
I don't do Office Interop at all, so this may be wrong.
But, did you add the reference to the Excel Object Library under the COM tab, or did you use the Office Primary Interop Assemblies under the .NET tab??
|
|
|
|