
spebola
Avatar/Signature-
Posts
50 -
Joined
-
Last visited
Personal Information
-
Occupation
self-employed
-
Visual Studio .NET Version
Professional
-
.NET Preferred Language
vb.net
spebola's Achievements
Newbie (1/14)
0
Reputation
-
dynamic_sysop, I make my living programming not at comedy. There are forums for comedy, I am sure. When I post a question and receive an e-mail stating that I have a response, it is disappointing to read a post that says wipe your screen with a wet towel. I might have said that in the 3rd grade (if there were computer screens back then). I did a lot of research (and even learned the "Dirty" terminology) before I posted this question. I was well aware of the text changed event (should be named the keystoke made event) and methods using bound controls. That is why I stated that the controls were unbound in my question. Notepad does not use the text changed event (open notepad key in 2 blanks and 2 backspaces, no prompt is issued when exiting) and certainly it is not bound to a data source. I thought there must be some magic method to accomplish the IsDirty state. There is a lot of magic in .Net (or any o-o lang.) when compared to 3rd generation languages, such as inheritance and polymorphism and classes. But after careful consideration, I have coded this question the old fashion way. I have posted several questions on this forum, and for the most part received excellent responses, and this post received some excellent responses, responses that made me look at the problem from different view points. I work out of my home and have no other programmers to bounce around ideas. So this and other forums have been a great help, especially for an old programmer trying to learn a new platform and language. FYI: I have been programming for 37 years (I was a Vice-President of IT 28 years ago, and didn't like management) and to me it is still just a way of making a living, no romance in the occupation at all. Albiet, it has been a lucrative occupation and has educated my kids. Currently, the only programming I do is minor support for systems I wrote in the early 80's that are still leased. I didn't write a line of code or for that matter work at any occupation for the years 1998 - 2002 (lease income is sufficient). I have one client (has leased my software for over 20 years) that wanted me to convert those systems to the Windows platform. I started in January of this year. I am about 40% done, and when I work on these systems I am serious (I want to have it done). I am coding this system to work with Oracle 8i (no JOIN keyword among other difficulties), Oracle 9i and MS SQL 2000 at their request. But this project is a minor part of my life. You can be sure that about 70% of my time (awake hours) is goofing off, playing golf, drinking beer with my pals, etc. In fact, my pals and my wife will get a big laugh when they read your comment about my being serious 24 hours a day. They know that is about as far from the truth as you can get, and they would say that it would be very difficult for me to look at things a little bit more on the light-hearted side. I will try to be more understanding in the future.
-
Thanks for the ideas mothra, mutant, dsgreen57 and nerseus.
-
wyrd, I do want to detect a change in a text box contents, but not for each keystroke in the textbox. As I stated eariler, if the user keys 100 characters in one textbox, the text changed handler is executed 100 times. That may be insignificant overhead, but I prefer to do it another way. The text changed handler will not detect if the contents changed, just the fact that the user made keystrokes in the texbox. The user could key data in the text box and then press the backspace key until the textbox contained the original contents. If the user then clicks the Exit button, there is no need to do the prompt. The same applies to the combo box. The user can select a new item from the drop down list and then change it back to the original selection (in effect, no changes). Before I post a question, I try and do as much research as possible, because I learn more doing the research. I had explored all the events with the textbox and combo box and decided that none suited my purposes (these events detect keystrokes, not content change and keystokes do not necessarily mean content change). All other processes I could find in forums were about data bound controls not unbound controls. It is apparent that I must compare the contents at exit time with the original contents, using either the tag property or a structure data type, to achieve the result I prefer. I do not want to prompt the user if the contents did not change, no matter how many keystrokes the user made. I don't know where you got the idea that I was insulted or felt insulted. When I read the posts above I get the impression that I was the insulter not the insultee.
-
Thanks for the reasonable responses. The text changed event will still raise the event 100 times if the user keys in 100 characters in a text box. I see no good reason to use the text changed event for this purpose. (this would evaluate the if and set the boolean value 100 times. It would work but probably is not the most efficient way, which I already new.) I will probably create a structure in the load event (with each textbox contents)and compare it with the textbox contents in the exit routine. As for insulting people on this forum, they asked for it by making the responses they made. They probably had no idea what "Dirty" meant but feel a need to respond to every post.
-
The problem with the text changed event (for text boxes) is that it is raised when the text box is initialized in the form's load event (not changed by the user) and with each keystroke in the textbox (when changed by the user). Due to the comments posted to this thread, I will repost this question at a forum with more experienced and mature programmers.
-
Use the wet paper towel on your double screens.
-
I have a form using unbound controls (text boxes and combo boxes) with a "Update" and "Cancel" button. If the user makes any changes on the form and then clicks "Cancel" I want to display a form asking if they want to save the changes. What is the best method to determine if the form is "Dirty"? I am using VB.Net 2003.
-
Word Find/Replace question
spebola replied to spebola's topic in Interoperation / Office Integration
Yes, I am sure it refers to oRg.Wrap. I moved the .Wrap line below the .MatchCase line, and the same error occurs on the .MatchCase line. But the first two (.Clearformatting & .Forward) do not generate the error. -
Word Find/Replace question
spebola replied to spebola's topic in Interoperation / Office Integration
Thanks for the responses. The NEW keyword is not allowed for word.document or word.range objects. I don't understand why the error appears at the .Wrap statement instead of at .ClearFormatting if the object does not exist. -
I am trying to do a find/replace text in a word document. The code is: Dim wrdApp As Word._Application Dim wrdDoc As Word.Document Dim oRg As Word.Range Dim mFind As String Dim mReplText As String Dim FileName As String mFind = "<Agreement Date>" mReplText = Format(mdy, "MMMM dd, yyyy") wrdApp = CreateObject("Word.Application") wrdApp.Visible = True wrdDoc = wrdApp.Documents.Open(FileName) wrdDoc.Select() oRg = wrdDoc.Range With oRg.Find .ClearFormatting() .Forward = True .Wrap = Word.WdFindWrap.wdFindContinue .MatchCase = False .Text = strFind .Replacement.Text = strReplace .Execute(Replace:=Word.WdReplace.wdReplaceAll) End With When this code is executed I get an error at the .Wrap statement. Error message "Object reference not set to an instance of an object". What step am I leaving out? I am using vb.net 2003 professional and Office XP. Any comments would be appreciated.
-
ClientID = SearchList.FocusedItem.Text
-
burak, Do you have .Net Framework 1.1? Post your code.
-
Are you getting any error messages? Either the connection is not being made, the table is not found, or no data exists in the table that satisfy the WHERE clause. The user/password in the connection string must have created the table or has been granted select privileges on the table. Add a Try, Catch, End Try block to the code and display the exception in a messagebox. Also, you need to close the data reader and the connection. Try open connection . . . execute reader Catch ex as oracleexception messagebox.show(ex.message) end try rest of code
-
Microsoft suggested the following to eliminate some of the errors on inherited forms when converting from .net 2002 to .net 2003: On the base form (parent) make sure each control's modifier property is set to Protected Friend. I selected a control (surrounded by grey box indicates it is selected), pressed Ctl-A to select all controls, displayed the properties window (all properties in common to the selected controls are displayed, which in most cases will only be the Modifiers property) and changed all controls to Protected Friend at once. This eliminates the click event handler errors and also allows you to modify/add to the control on the inherited (child) form. Phantom errors still appear when you try to modify the base (parent) form. They indicated they would have a solution for this problem shortly.
-
This is just a suggestion (I haven't tried it). Try adding the following after the multiline statement. dg.PreferredRowHeight = theCol.TextBox.Height