|
-
Jul 6th, 2007, 09:08 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2005] Excel Functionality.
I am working on a grid that is pretty much Excel. I am going to parse out the text box string and check for multiple things, mainly stored functions ( =, +, -, /, *, sqrt).. What is the best way to go about doing this process..

And also, while i'm in the text box, would i be able to select cells and get their value? I was thinking I would have to do it like this..
vb.net Code:
If textBox.focused() then
flag = true
end if
sub Grid_Click () ...
if flag = true
textbox.text += "[" & col & row & "]"
textbox.focus()
end if
end sub
Last edited by NPassero; Jul 6th, 2007 at 09:13 AM.
-
Jul 6th, 2007, 09:13 AM
#2
Re: Excel Functionality.
In the cell click event do this
Code:
Text.text = dgv1.CurrentCell.Value.ToString
Please mark you thread resolved using the Thread Tools as shown
-
Jul 6th, 2007, 09:14 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] Excel Functionality.
well i know that, but how would i parse it out to solve the equation..
-
Jul 6th, 2007, 09:16 AM
#4
Re: [2005] Excel Functionality.
What you mean parsing here ? This one
Code:
Text.text = Integer.Parse(Text1.text)
Please mark you thread resolved using the Thread Tools as shown
-
Jul 6th, 2007, 09:17 AM
#5
Thread Starter
Hyperactive Member
Re: [2005] Excel Functionality.
not really parsing. but going from "=123+456" to => "579"
solving the equation..
wrong word choice.
-
Jul 6th, 2007, 09:41 AM
#6
Re: [2005] Excel Functionality.
I guess you could use Substring and IndexOf to get everything before and then after the operator and then calculate based upon the Substrings that you pulled out.
Or I bet this has a good way to do it. The first on the list of major features:
Parses and evaluates Excel-style formulas
http://www.codeproject.com/vb/net/FormulaEngine.asp
-
Jul 6th, 2007, 09:42 AM
#7
Thread Starter
Hyperactive Member
Re: [2005] Excel Functionality.
wow, i was looking all over for one of those. haha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|