2008 Working on a favorites system and

WEll i'm working on a favorites system for my webbrowser an I think I know how I can do it. I was planning on having a seperate form come up when you click to edit the favorite you would type your URL and display text there and then when you click the favorite in the dropdown box on the other form in would navigate to the webbrowser you specified. My problem is that it dosn't seem to recognize the text box becuas its on a differnt form. Is there a way I can declare that text box on the first form? And also How do I make the text in that text box stay there until someone changes it when I click ok it dissapears. Thanks
      Answer1:Wait I managed to get the first problem resolved. If you put the code Code:
      Answer2:Hey,If you are wanting to save of these favourite links then you are going to have to put them somewhere, i.e. on the file system in a database etc.This can be done in a number of ways, for instance, writing all the favourites to a text file and then reading this in when your form loads. Or, you could create a class which represents the favourite, and then serialize this class out to a file when the form closes, adn then load it in again when the form opens.There is a link in my signature that explains how to do the latter.Hope this helps!!Gary
      Answer3:Is there any way just to save the text in that text box? What link?
      Answer4:Hey,When you open and close the form again, everything reverts back to the default values, so you can't just set the text. You have to store it off "somewhere", and then set the text property when you load it up again.Check the Serialization link in my signature.Gary
      Answer5:So for what I am trying to do (which is basicly having the text stay in the text box after I close it) would I put this code in for when the user hits the OK button Code:
      Answer6:Hey,So have you also used the CustomSettings class? Before the code you have posted will work, you need to implement this class, or create your own class and populate it with the information that you want to retain.Gary
      Answer7:Well i'm not sure what do you think would work best for this? And how would I implement the class/ creat my own class?
      Answer8:Hey,I think that it would be a logical step of create a class to store the Favourite information, and if nothing else it will be a good learning exercise to go through. You would want to expose properties in that class like URL, DisplayText, etc. You can add a class to the project by simply right clicking on the project and then add new item. Find class, give it a name and then hit ok.Gary
find my ip address area code map


Continue reading

Store HTML code as string

Is there a more efficient way of doing this than adding &""""& for every double quotation mark in the html code when building the string? I need to store the HTML code as a string. I am finding "[tablerow]" within an existing document with StreamReader and want to replace it with my string value (html code) when writing it back using stringwriter.
      Answer1:If you do two quotes "" inside of a quote, then it will read that as a single quote to be put in the quotes. Example:Code:
      Answer2:Hmmm. It still does not appear to like that. I am dealing with multiple HTML properties in the string, so there are lots of ""'s. Here's what I've got now:Code:
      Answer3:I ran across this article, but am still a little confused regarding the syntax:http://www.camelsquadron.com/forums/...?a=topic&t=173
      Answer4:If you are just building a large string with no replacement values, then forget about String.Format. Inside your string, replace every double quote with two doublequotes.Code:
area code map Delicious Tools


Continue reading

RESOLVED **Problem** Parseing text box line by line

text1.text gets data from another window every 500ms using a timerthe text from the other window is the same, but just like a chat, new lines are added to the bottom(I already have this)the timer needs to add all the lines that havnt been added already to a listbox.then for each new line in the list box, it will loop though them processing the text untill the end. the problem is that it needs to know not to add the same lines twice.
      Answer1:bump
      Answer2:A quick solution is, to create a Private level boolean value, that you can check in your code where you add the line to the TextBox.Private bDisableLineAdd as Boolean
...bDisableLineAdd = True: List1.Additem "blabla": bDisableLineAdd = False...
If Not bDisableLineAdd Then Text1.Text = Text1.Text & sNewTextEdit: But i'm not sure is this helps you. It may be better to see the codeflow, you may want to redesign it.
      Answer3:Quote:
      Answer4:1) For i = UBound(Chat) To LBound(Chat) Step -1 'because you are counting the elements reverse order, you have to set the step size negative.2) i see now. try thisCode:
      Answer5:I dont know how people like you can do this!did you litually write that directly on this forum?it worked exactly how i needed it... and im speechless! i thought id be struggleing on this for days. i even was about to go back to my original method... which never worked properly..ill show you my appriciation in a few days time
      Answer6:May be it's not feasible in the context of your program but, can't the GetText(chatHwnd) function clear the text in the other window. If the function performs a "clean up" then these issues disappear an you can just check for any text. Like this.Code:
      Answer7:I'm glad it works, i couldn test it, just type here as well.If you find your problem is solved, just go up here, and select the menu "Mark thread resolved" in the menu "thread tools".
      Answer8:Quote:
      Answer9:I found a problem with this Jim. it works fine at first, i have it on 1000ms timer.it starts off fine, but the loop takes longer and longer as it goes on, eventually taking over 1 second to complete, and it then starts getting every other line, then less and lessany ideas?
      Answer10:The problem is might because of the huge amount of content you have to display. Try to replace the Poker Textbox addition, to just display a single line, not add to the current content. Also remove the Listbox addition.The Split() should work fine, i dont see any other issues regarding this problem.Let me see how the performance drops.Code:
      Answer11:It parses it faster (as it doesnt have to display it).but still when it builds up, it doesnt refresh very well. takes longer each time, untill it starts missing lines.
      Answer12:Have you placed a DoEvents, somewhere in the processings? If so, just remove it.Also, the (, , vbTextCompare) in split not necessary at all, vbCrLf can be processed binary as well.
      Answer13:I had the timer set to 200.. ive changed it to 1000, so i will see how it goes.The idea is that it will read whats happeneing on a poker table, and it needs to be able to read the table for a long time, not missing any data, and not reading anything twice. it works perfect for the first 10 or so hands.
      Answer14:... i found a doevents... i dont know how it got there! honest!it was in the loop.
      Answer15:Ok, by removing the doevents, the process will be even faster. It will also dont miss lines, because the timer will not hit as long as the process is not finishing. So it solve the missing line problems.The another issue is that it takes so long to process the data. Can you please show me how you did it?For example, you just have to process those lines that comes new from the target textbox. The others are already processed. So it is better to place the processing in the loop where you add the lines to the textbox and listbox.Edit:
Another possible issue come in mind. What if the target textbox will be trimmed after a number of line counts? For example, most of the logging textboxes are trimmed after reaching the linecount 100. The code will fail in this case, because the counter will not get raised ever again... To avoid this to happen, you have to synchronize your code to this trimmings.
      Answer16:Hey, i just read your edit on the last post. As the problem seems to of come back again. but i have not got any DoEvents anywhere now. It will work upto about 400 lines? maybe less i dont know. but it slows to a halt. in the loop, it will call a function on a module, which goes though alot of checking on the line, like if it contains different words, then split it, add usernames to listboxes, call a DLL to do some heavy maths etc...i increased the timer from 200ms to 500ms, it helps slightly, but i cant increase it as it will need to be updated frequently.I have taken out the lines where it adds it to a text box and listbox, so it just calls a function instead now.any ideas?
      Answer17:Well 400 lines doesnt seems to me an issue, but it all based on your 'coding style'. For example, split()'ting up more than 10,000 elements to an array is could be done less than 100 milliseconds, or less. So it wont be an issue.Let us see the whole processing, from where you get the textbox content from the game, to the line of end sub. There could be some ways to optimize the process to give a significant speed up.
      Answer18:this is on a 500ms timer:Code:
      Answer19:What i'm see here, is that you continously cross reference between form and module (Form1.xxxx), that is a bad idea. Instead of that it would be better, to place everything on the form, there it will be able to call the controls without referencing them.Second, you can use StdPicture to store images in, so you dont have to loadpicture() the images, but you can simply pass the stdp to the picture boxes. Somewhere, in your initializations (eg Form_Load) load the images once to StdPictures.Code:
      Answer20:ill try the things you have said, ThanksThis loops though a list box to see if a player has already been added to the list.Checks first if the player being looked for is "you", ... so not to add yourself to the list.Code:
      Answer21:It would be better, to store the names in a local array, because calling a control's property, even its as array, takes even more processing time than simply calling a string array. You can store the names in this array, in sync with the listbox.Code:
      Answer22:Well to get the text from the window, i had to pay someone to work out a way to do that! as its not just as textbox, its an "Internet Explorer_Server" window, that i had no way of getting, here is the "GetText" function i have been using.Code:
      Answer23:It is may be reversed.1) GetText = htmlDoc.documentElement.outerText 'read the content
2) htmlDoc.documentElement.outerText = "" 'clear the contentSo it will clear the text area after read it. Then, in your code, you dont have to count the lines anymore, but you can simply split() the array, and process all its elements, because the received text will only contain the few last lines that are came between two timer ticks.
      Answer24:Merri has posted a fast version of split here, you may want to use it to improve the speed of splitting the text.And another idea you could use it to store in a variable the ubound of the last text and in succeeding splits you can just loop on that last ubound (+1) until the new ubound. Something likeCode:
      Answer25:@dee-u your second suggestion is that the code exactly does, but the problem is appears at, when the code have to process 400+ lines. There i suggested some improvements and workarounds for this issue, but it might be even better to using the same way the code gets the content, it may allow to clear the remote textbox, so the content will be just a few lines, that is should be extremely fast.Unfortunately i got no any response that the workaround is works or not.
      Answer26:Well i havnt done that yet! i decided to try alot of things at once. im going to test to see if i can remove old text now, and i will let you know how it goes.as somthing i have realised also, that the way i had this poker window open, was with the chat window on the side, its much bigger than having the chat window within the poker window. i think that within the window it automatically clears after 1000 lines... but im testing that now also.although it looks like now that they have done an update to the software, it no longer clears..
      Answer27:wasnt able to change the text,"cannot set the outertext property.."
      Answer28:Ok, just try one of the following.htmlDoc.documentElement.Value = ""
or
htmlDoc.documentElement.Text = ""
or
htmlDoc.documentElement.innerText = ""
      Answer29:all 3 gave same errors.
      Answer30:Hey, i just thought of somthing which technically should work, and we have been missing...instead of trying to clear the external chat, why not i get the text from the window into a textbox, then process it from there, that way it is simple for me to clear?
zip code finder currency converters


Continue reading

2005 How to run event handler code on form load

I have a form that is built and loaded dynamically when File/open is selected.however I now want to use the same code to open a default file and
populate the form using the Form load event to call:Code:
      Answer1:Hey,Have a look at the PerformClick Method:http://msdn.microsoft.com/en-us/libr...formclick.aspxHope this helps!!Gary
      Answer2:you have 3 options really1) make a seperate subroutine and move all the code in the OpenToolStripMenuItem_Click routine to that seperate routine. Lets call this routine PopulateForm()So your code would look something like this:Code:
anonymous web proxy Delicious Tools


Continue reading

Changing the Function Paramters with changed stored Procedure

Hi All,I have developed business object with three parameters,which are passed same three parameters passed to the stored procedure. Due to the project enhancement I have to add extra new field in the table and new field will work for one form. I changed the stored procedure with four parameters and fourth has default and third also default. Now my issue is when fourth parameter is not required, I will pass only three values to vb function and when third is not required I will pass the same. Whether I need to add fourth parameter in vb function or I have to add the fourth paramter. If I pass three paramters then am facing error like 'Type Mismatch',because I'm not passing third paramter which is numeric when am passing the fourth parameter.Please suggest is there any better approach.
      Answer1:Moved From The FAQ Section - VB6 Assumed
      Answer2:If you have set the VB function up to have Optional parameters, simply leave the third one blank - but include the commas that separate the parameters, eg:Code:
loan Calculator area code map


Continue reading

RESOLVED Save listview headerNeed help plz

Hi, i have a code that save the listview item into textfile. It saves in a row for every row of listview as shown in the picture. However, i would like to add another row for the listview header like:latitude, longitude, time, statusMay i know how i can do this? Thanks in advance. Below is the code which save the listview item.Code:
      Answer1:Use the same method. Just loop thru the ListView1.ColumnHeaders collectionCode:
      Answer2:Hi, LaVolpe. I have edited the code after took your advise. But the headers does not arrange in a row but in few rows. May i know how to make it as one row?Code:
      Answer3:You want the headers to appear on a single line in the text file? If so, add the ; symbol like soCode:
      Answer4:Opps...I meant single line here instead of single row. Sorry for misleading. I have tried the code and it works well. Thank you, LaVolpe.
currency converters Delicious Tools


Continue reading

RESOLVED 2008 try statement

hi im just wondering how the try statement works. what i want to do is this:allow user to enter link eg "calc.exe" then open that link using shell like this:Code:
      Answer1:If you are trying to execute a program then you may also want to check if the file exists before trying to execute it. And you can just wrap it with Try Catch blocks.
      Answer2:first you must useCode:
      Answer3:thanks alot
      Answer4:your welcome
      Answer5:ok thread resolved!!!
currency converters area code map


Continue reading

Copyright 2008