|
There are articles, here at CP about managed DirectX [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
basically, what I'm trying to do is just acquire a piece of data from the last line in a text file.
Not sure if it's enough but, this is the code I'm using as a base to build from.
public double LastATMBalance()
{
double lastatmbal;
foreach (DailyBalance dailybal in dailybalance)
{
lastatmbal = Convert.ToDouble(dailybal.ToString());
}
return lastatmbal;
}
and this is the format of the text file i'm using.
3/27/2000,4800
3/29/2000,7750
3/30/2000,6990
3/31/2000,5000
4/6/2000,5000
11/12/2004,5000
6/9/2004,9990
2/20/2006,5000
4/1/2006,5000
4/9/2006,5000
not sure anymore info is needed.
Thanks for any assistance provided.
|
|
|
|
|
Hi,
I don't see a question, so what is your problem?
remarks:
1. your code won't compile since lastatmbal is not guaranteed to get a value.
2. why convert all the DailyBalance objects when the only one of interest is the last one?
|
|
|
|
|
what is dailybalance ? Is it a generic list? An array?
If it's a generic list, you could use dailybalance.Last() .
If it's an Array , you could use dailybalance[dailybalance.Length - 1]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
i have a senario, 3 buttons and 2 gridviews.The buttons(three buttons) related to the information in first Gridview is clicked, it populates the second gridview with the corresponding table in database. Now my_method needs to know which button is clicked, so that it uses stored procedure to do some database operations on that particular table.
Is there any way to get the value from button_clicked() to my_method, without calling my_method. The value will be used only when my_method() is called by some other operation.
Thanks
|
|
|
|
|
You could store the information in a field on the class in which the method resides.
|
|
|
|
|
Hi,
class
{
protected void Button1_Click(object sender, EventArgs e)
{
resbutton = "abcMenu";
.....
}
protected void Button2_Click(object sender, EventArgs e)
{
resbutton = "defMenu";
.....
}
protected void Button3_Click(object sender, EventArgs e)
{
resbutton = "jklMenu";
.....
}
protected void Button4_Click(object sender, EventArgs e)
{
resbutton; // here i need the value of resbutton for different above button_click events
.....
}
}
fields are not working properly. can u provide me some related code.
Thanks
|
|
|
|
|
suni_dotnet wrote: fields are not working properly.
I don't see any evidence from this code that you have a field at all.
Here is your code re-written:
class MyForm
{
private string resbutton;
protected void Button1_Click(object sender, EventArgs e)
{
resbutton = "abcMenu";
}
protected void Button2_Click(object sender, EventArgs e)
{
resbutton = "defMenu";
}
protected void Button3_Click(object sender, EventArgs e)
{
resbutton = "jklMenu";
}
protected void Button4_Click(object sender, EventArgs e)
{
switch(resbutton)
{
case "abcMenu":
break;
case "defMenu":
break;
case "jklMenu":
break;
default:
break;
}
}
}
Of course there may be better ways of doing this, but since we don't know what your actual overall goal is we can't say. Christian's suggestion of using delegates has merit also.
I'd also suggest using something other than a string for the field. Creating a specific enum that enumerates each type of button would be good.
|
|
|
|
|
sounds like you want to use a delegate.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You're starting to sound like "Clippy".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i want to implement samll system that can retrieve information from some file, but i really don`t know how to do it? how to calculate Term frequency? how to indexing? i want to do it in C#.NET
|
|
|
|
|
Sounds like you need to hire someone, talk to your teacher, or tell your client they hired the wrong person,depending on your reason for wanting to do this.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Generally, the marker size of the legend should be changed automatically with changing the marker size of the corresponding series.
but I found that when the marker size of the series is increased to larger than some value, the maker in the legend does not change at all!
(it is changed only when the marker size is increased from very small value to some value, then it is not changed anymore!)
is this the bug of Chart Control? I found the maximum marker size in the legend is too small for me, I try to make it bigger, but I can not.
anyone can help me to clarify it?
|
|
|
|
|
I compare the speed of plotting between Zedgraph and MS chart control,
I found MS chart control is much slower than Zedgraph. Anyone knows the reason? Or just because MS chart control
contains more functions which may need more time for initialization or because MS chart use differet implementation technique from the one Zedgraph?
|
|
|
|
|
How can we possibly answer your question unless we know how you came to this conclusion?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
thanks for your reply.
I just plot the same line chart with Zedgraph and MS chart control (i.e., the same x and y list values), then the time taken by MS chart control is much longer than Zedgrah.
|
|
|
|
|
Are we talking minutes, seconds, days? You gotta provide more info.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Well, two things
1 - are you sure it's faster for ALL graphs, or just the type you're testing
2 - why do you care ? Just use the control that works best for you.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Your testing, or results, is very incomplete.
Besides, the MSChart control is older than dirt itself, wasn't designed with the .NET Framework in mind (interop overhead, and pre-dates even the idea of the .NET Framework). Then there's ZedGraph, which was designed entirely under .NET. Is it really such a surprise??
|
|
|
|
|
Hi
i want share my exe app in network and users can run it via network, but i need grant full trust permisson to my assemblies, but i don't know how to do that.
Note 1 : i don't want to do this by caspol.exe, i want to do this by code or setting properties(within my app).
Note 2 : i found this url[^] for grant permisson to assemblies (Using the Trust Assemblies Location Property), but it is for VSTO and i want to do this for Visual Studio 2005.
can anybody help me ?
Thanks
|
|
|
|
|
I'm not sure a) you can do that programatically, or that b) it's a good idea. Security is put into place for a reason, and any application that attempts to circumvent it should be untrusted.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Saturday, January 3, 2009 5:58 AM
|
|
|
|
|
Hi John
if you follow that link, it's possible to do that programatically.
|
|
|
|
|
Yes it is possible to do it programatically. Obviously your application will need to be full trust to do it.
Think it though! What would be the point of having this security if an application can just grant themselves the permissions they don't have without any checks?
|
|
|
|
|
Thanks Mark
I don't have any security policy, i want only test it and do that which how to set app full trust programatically ?
Thanks
|
|
|
|
|
Hi
I have a very strange problem. I am using Visual Studio 2005 and C# to develop a Windows application. My database is a MS Access 2003 database.
On my Form I have a DataGridView that is bound to a table in the database. There are also a few DataGridViewComboBoxColumns that are bound to different lookup tables in the database. I specify the BindingSources for all of these using the designer. When I run the app the DataGridView is populated as expected. The DataGridViewComboBoxes also work fine and I can change the values. The database is also updated correctly. So everything seemed fine.
Then I added a Button control to the form by dragging a Button control from the Toolbox onto the Form. Before I added any further code I ran the app again to check something. This time I encountered a problem. After I clicked the Close button in the Controlbox (Top right on the form) the DataGridView gets cleared of data row by row and when all the rows have been cleared the following message appears: "Index 0 does not have a value.".
I just cannot see the relationship between just adding a Button to the form and this error message.
I am stumped and any advice will be appreciated.
Regards.
Kobus
|
|
|
|