Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
L

Latheesan

@Latheesan
About
Posts
41
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Improve RichTextBox performance
    L Latheesan

    How can i create a line-oriented text editor of my own with syntax highlighting ability?

    C# performance tutorial question code-review

  • Improve RichTextBox performance
    L Latheesan

    Hello, I just found out that, my editor made of rtb lags really bad when the number of lines is longer than 100 for example. Could it be because im using the syntax highlighting textbox library to highlight syntax inside the editor? Is it possible to increase the performance of it somehow so it doesnt lag ever sec as you type.

    C# performance tutorial question code-review

  • Syntax highlighting textbox
    L Latheesan

    Okay, i did some searching and using this code, i fixed this second problem - http://www.codeproject.com/cs/miscctrl/SyntaxHighlighting.asp?msg=1194287#xx1194287xx[^] However, i still have the first problem... does anyone have any idea how to solve this?

    C# database com graphics tools help

  • Syntax highlighting textbox
    L Latheesan

    Same with having everything inside " and " brown, i did this: shtb.HighlightDescriptors.Add(new HighlightDescriptor("\"", "\"", Color.Brown, null, DescriptorType.ToCloseToken, DescriptorRecognition.StartsWith, false)); I compiled the app and tried to type like this "hello" and only once the first double quote became brown and then as soon as i typed the h, it stopped being brown. Where im i going wrong? how can i get this right? Thanks in advance for any help you can offer

    C# database com graphics tools help

  • Syntax highlighting textbox
    L Latheesan

    Hello, I am using this library in one of my project : http://www.codeproject.com/cs/miscctrl/SyntaxHighlighting.asp[^] This is how i used it in my editor i've been working on: /* Create a new SyntaxHighlightingTextBox */ shtb = new SyntaxHighlightingTextBox(); shtb.Name = "shtb"; shtb.Location = new Point(0, 0); shtb.Dock = DockStyle.Fill; shtb.WordWrap = false; shtb.ScrollBars = RichTextBoxScrollBars.Both; shtb.FilterAutoComplete = false; shtb.AcceptsTab = true; shtb.DetectUrls = false; shtb.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); /* Separaters */ shtb.Seperators.Add(' '); shtb.Seperators.Add('\r'); shtb.Seperators.Add('\n'); shtb.Seperators.Add('\t'); shtb.Seperators.Add(','); shtb.Seperators.Add('.'); shtb.Seperators.Add('-'); shtb.Seperators.Add('+'); /* Controls */ shtb.ContextMenuStrip = EditorContextMenu; Controls.Add(shtb); this.Controls.Add(this.MainMenu); /* Syntax Highlighting Keywords [ BLUE ] */ try { TextReader syntax_blue = new StreamReader("synHighLib_DB/blue.txt"); string line = syntax_blue.ReadLine(); while (line != null) { shtb.HighlightDescriptors.Add(new HighlightDescriptor(line, Color.Blue, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true)); line = syntax_blue.ReadLine(); } syntax_blue.Close(); } catch (Exception e) { MessageBox.Show("Exception Error : " + e.Message, "eAthena Script Editor"); } This is the contents of my blue.txt db file 0 1 2 3 4 5 6 7 8 9 As you can see, i want to turn all interger that the user types in the editor into blue color. When i tried this in the compiled app, this is how it looks like: http://img254.imageshack.us/img254/989

    C# database com graphics tools help

  • exception error caused by reading text file
    L Latheesan

    Im using something called syntax high lighting textbox library in one of my project. To be able to easily highlight syntax, i wrote this lil code: /* Syntax Highlighting Keywords [ BLUE ] */ TextReader syntax_blue = new StreamReader("synHighLib_DB/blue.txt"); while (syntax_blue.ReadLine() != null) { shtb.HighlightDescriptors.Add(new HighlightDescriptor(syntax_blue.ReadLine(), Color.Blue, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true)); } syntax_blue.Close(); It compiles properly, but when i start typing into the text box, i get the unhandled exception error. Im 100% sure this is the code that causing the error, because, when i remove it, it works fine...

    C# help

  • Case Sensitive Issue with XML
    L Latheesan

    Hi, Im trying to do a simple XML Record Lookup using the following code: string fileName = "Account_Data.xml"; XPathDocument doc = new XPathDocument(fileName); XPathNavigator nav = doc.CreateNavigator(); XPathExpression expr; expr = nav.Compile("/Accounts/Account[FirstName='" + nameTextBox.Text + "']"); XPathNodeIterator iterator = nav.Select(expr); iterator = nav.Select(expr); if (iterator.MoveNext()) { // Record Found } else { // Record Not Found, So Create A New One Here } It works just fine, but there seem to be a minor bug with it. In the XML file, i already have a record with Latheesan, so when i searched using my search form for "latheesan", it returned 0 results, hense it created a new record. How can i avoid case sensitiveness issues with searching through XML Records?

    C# help question algorithms xml

  • Force a Form to Close
    L Latheesan

    Yup, thanks allot for the info. The need to close the Search Form before opening the Editing Form isn't exactly in the project requirement, it's a little feature i wanted to add, because 1) im a uber perfectionist and 2) it would have looked more professional and more user friendly (I felt as if i didnt have the search form close, it'll look messy with 3 form windows open from 1 software). Thanks anyway =)

    C# testing beta-testing xml question

  • Force a Form to Close
    L Latheesan

    Oh i get it. Is there any way to get around this?

    C# testing beta-testing xml question

  • Force a Form to Close
    L Latheesan

    Oh yea, i tried that too and it didn't work either. Normally Close(); alone just works fine, but in this case, it's acting quite wierd...

    C# testing beta-testing xml question

  • Force a Form to Close
    L Latheesan

    You obviously don't know C#, do you?

    Yea you are correct, im still learning :-O

    C# testing beta-testing xml question

  • Force a Form to Close
    L Latheesan

    Correct me if im wrong, but isnt "this." used to select the current opened/active form? Even if i don't use this.Close(); i tried the following options to form the form to close: Close(); AdvSearchForm.ActiveForm.Close(); Still no luck, this is what i could think of top of my head and from my past exprience with form closing...

    C# testing beta-testing xml question

  • Force a Form to Close
    L Latheesan

    Hello, I have this search method which is called when the user enter some value into textbox and presses Search button. If a record is found, it's supposed to open a form called Account Management Form. What i wanted to achieve was, Close the search form right after the record is found and Acc Management Form is being opened. this is the code i have so far: private void doEditAccount(IAccount account) { this.close(); AccountManageForm form = new AccountManageForm(account); form.ShowDialog(); } private void searchBtn1_Click(object sender, EventArgs e) { string fileName = "Account_Data.xml"; XPathDocument doc = new XPathDocument(fileName); XPathNavigator nav = doc.CreateNavigator(); XPathExpression expr; expr = nav.Compile("//Account[@ID='" + accountIDInput.Text + "']"); XPathNodeIterator iterator = nav.Select(expr); iterator = nav.Select(expr); if (iterator.MoveNext()) { XPathNavigator nav2 = iterator.Current.Clone(); string tmpAccID = (nav2.GetAttribute("ID", "")); nav2.MoveToFirstChild(); string tmpName = (nav2.Value); IAccount account = new Account(tmpName, ""); doEditAccount(account); } } In theory, shouldn't the search form get closed because of the line this.close(); inside the doEditAccount method and then open the Acc Management Form... but in my testing, the Adv Search Form won't close. Im i doing something wrong? or is there another way to force a form window to close before opening another one?

    C# testing beta-testing xml question

  • cannot convert from 'string' to 'AccountManagement.IAccount'
    L Latheesan

    But you didn't pass a bank object to the form.

    I didn't need to, so i ended up removing the line IBank bank;

    C# help regex xml question

  • cannot convert from 'string' to 'AccountManagement.IAccount'
    L Latheesan

    Nevermind, i fixed it by removing this line: bank.AddAccount(account); from the search method and it seems to be working. I know this is terrible, trial-and-error method is not a good way to learn new programming language, but im short on time. Im just glad its working and i can move onto the next piece of work.

    C# help regex xml question

  • cannot convert from 'string' to 'AccountManagement.IAccount'
    L Latheesan

    Great, brilliant suggestion. I added the following line towards the begining of the partial class: IBank bank; editted the search method like this: IAccount account = new Account(tmpName, ""); doEditAccount(account); bank.AddAccount(account) And i was able to successfully build the solution. However, when i use the search form and enter an account ID and click search, it opens the account management form correctly, but when i close the account management form, i get this exception error message: http://i9.tinypic.com/4poqqab.png[^]

    C# help regex xml question

  • cannot convert from 'string' to 'AccountManagement.IAccount'
    L Latheesan

    Thanks allot sir for your reply, but im a bit confused by what you said, since i've never programmed before till few months ago, im still getting used to using Visual Studio C# Express software and learning C# This is for my programming course (1st year) and it's alrady doing my head.

    C# help regex xml question

  • cannot convert from 'string' to 'AccountManagement.IAccount'
    L Latheesan

    Thanks for your reply again, i tried to put it in, but it said the doFindAccount method is not found. Even if i managed to get the method working, the problem is that, the doFindAccount searches for account in the hashtable. When im searching for the first time, this account name would not be in the hashtable. So, i looked at my main form and found this code that adds new account: IAccount account = new Account(nameTextBox.Text, ""); account.SetAccNumber(nameTextBox.Text); doEditAccount(account); bank.AddAccount(account); So, from that, i see, the code adds the account to the hashtable and then it does the editing part by opening the acc manage form. So, i tried to do this in my search form like this: IAccount account = new Account(tmpName, ""); doEditAccount(account); bank.AddAccount(account); this.Close(); Now the previous error is gone and have a new one:

    The name 'bank' does not exist in the current context

    The AdvSearchForm is VERY similar to the MainForm, yet how can the form cannot find the instance 'bank' ?

    C# help regex xml question

  • cannot convert from 'string' to 'AccountManagement.IAccount'
    L Latheesan

    Thank you very much for that prompt reply. I looked at my orignal code inside my MainForm which already had this doEditAccount method which is working fine, i could not see anything different from what i am trying to do on my search form. Have a quick look at the working code (if you have time) - http://nopaste.php-q.net/294607[^] The orignal working form does not need any parameter passed into the doEditAccount yet it works fine :s

    C# help regex xml question

  • cannot convert from 'string' to 'AccountManagement.IAccount'
    L Latheesan

    Hi, I made a new form on my project that allows my user to search using specific search criteria. Once the record is found, i need to be able to open the Account Management form, so i have a code that looks like this: private void doEditAccount(IAccount account) { AccountManageForm form = new AccountManageForm(account); form.ShowDialog(); } private void searchBtn1_Click(object sender, EventArgs e) { try { string fileName = "Account_Data.xml"; XPathDocument doc = new XPathDocument(fileName); XPathNavigator nav = doc.CreateNavigator(); XPathExpression expr; expr = nav.Compile("//Account[@ID='" + accountIDInput.Text + "']"); XPathNodeIterator iterator = nav.Select(expr); iterator = nav.Select(expr); if (iterator.MoveNext()) { XPathNavigator nav2 = iterator.Current.Clone(); string tmpAccID = (nav2.GetAttribute("ID", "")); nav2.MoveToFirstChild(); string tmpName = (nav2.Value); nav2.MoveToNext(); string tmpLastName = (nav2.Value); nav2.MoveToNext(); string tmpBalance = (nav2.Value); nav2.MoveToNext(); string tmpOverDraftLimit = (nav2.Value); nav2.MoveToNext(); string tmpFullAddress = (nav2.Value); doEditAccount(tmpName); this.Close(); } else { MessageBox.Show("Sorry, I could not find any account for\r\nAccount ID : " + accountIDInput.Text + "", "Friendly Bank"); } } catch (Exception ex) { MessageBox.Show("Error : " + ex.Message); } } When i try to build the solution to test this out, im getting this following error(s):

    Error 1 - The best overloaded method match for 'FriendlyBank.AdvSearchForm.doEditAccount(AccountManagement.IAccount)' has some invalid arguments

    Error 2 - cannot convert from 'string' to 'AccountManagement.IAccount'

    Could someone help me out, where im i going wrong? the code looks right to me, but the compiler begs to differ :(

    C# help regex xml question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups