|
If you are interested to see how it would be done without any goto s post back. Even better, try doing it yourself without any goto s and if you have in trouble in the process, post your questions here again. After you have it in the goto -free state, you can decide for yourself whether the code seems better.
(Actually, with a small example like this, it will not be clearly better, but I've seen very large pieces of production code that use goto s and that becomes hideously incomprehensible and hard to maintain).
Matt Gerrans
|
|
|
|
|
Need to build a two dimensional math graph.Anybody can give me any ideas about how to do it?
|
|
|
|
|
I have this graphic, that I want to move up and down the form by the user clicking on one button to go up and one button to go down, it sounds like a game, but it really isn't. I have no idea on how to make or even start on this project, can it be done with C#.Net? and do I use DirectX? or the Drawing Class?
|
|
|
|
|
<code
private void="" btnmove_click(object="" sender,="" system.eventargs="" e)
="" {
="" this.location="new" point(this.location.x="" ,="" this.location.y="" -50);
="" which="" moves="" current="" form="" 50="" pix="" up="" and="" so="" on="" ..=""
="" }
="">
I hope this works.
|
|
|
|
|
How are you planning to display the graphic? Through a standard PictureBox control? Or are you going to draw it yourself?
Either case, you need to track the current position of the graphic using a variable and update the position in the button click.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
It is actually am Image, so I guess a picture box control.
|
|
|
|
|
Then it becomes fairly simple. Just change the Top/Left properties of the PictureBoxControl and you're done.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
I want to make Tablet PC application using C#.
I was serching on google and found that I need to "add reference" (in Solution Explorer) . And then Need to add the reference of "Microsoft Tablet PC API" as a component name but I am not able to find that. What should I do?
Thanks
I would appreciate if you could check this on the platform.
Thanks in advance
Preeti9
|
|
|
|
|
Hi,
My C# / Winform program talks to a COM (OLe Aotomation) server. I need
to pass the handlw of a combobox to the COM server and the server will
populate the combobox by sending CB_ADDSTRING message. The result is: the
combobox got populated but when I dropdowm (the combobox is DROOPDOWNLIST
style) I got very narrow dropdown part with a tiny scroll bar, and if I
select an item I got a System.ArgumentOutOfRangeException. In code just
after the server populated the combobox I can see that MyCombobox.Items.Count is 0. We know in C# .NET code we add string to combobox this way: MyCombobox.Items.Add("abc"). It seems if we use the
CB_ADDSTRING to add strings to a .NET combobox the Items is empty.
Any one got the similar problem?
Thanks in advance for any help.
Bogang Tian
|
|
|
|
|
Windows Controls are not thread safe.Any
attemp to play with them in external code may result to undesirable results such as yours.
If you can return that string (for example via an event in that activex) to your code this
whould do the job.
<br />
private delegate void AddTextDelegate(String strText); <br />
private void AddText(String strText) <br />
{ <br />
MyComboBox.Items.Add(strText); <br />
} <br />
and in your event handler:
<br />
Invoke(new AddTextDelegate(AddText), <br />
new Object[] { strText});<br />
I hope this works.
|
|
|
|
|
Thanks for your help.
That "COM server" is only an OLE Automation server. It does not fire any
event. Only thing it offers is a member function that takes an int as
the handle of the combobox, and populate the combobox by sending CB_***
messages.
I am curious: after calling the COM server member function I can see
the combobox is populated with data. Where are these data stored? Any
way to get them and put them them into the Items collection?
Thanks again.
Bogang Tian
|
|
|
|
|
Hello everyone!
OK, I have a program that has to find files inside of some specific directories and then add the filenames to a string array. There's like 18,000 files... My problem: The last line on the file comes cut out. I thought this was some file limit problem, so I broke it down into 2 files. Still the problem persisted. Then I went for 4. Still. Then I went to 6. STILL! Anyone know what's wrong here? The files are on a network drive, but I don't think that's it, since I've seen this problem a long time ago on regular drives. Anyone know how to fix it? Thanks!
Sulfurik K. Nosferathus (Darth_Sulfur)
www.SulfurMidis.com
www.SulfurSoft.tk
http://www.BeepXtreme.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Are you calling Flush and/or Close on the stream when you are finished?
|
|
|
|
|
|
"It worked!" ?
This seems funny to me, because it implies that closing a file after writing to it is some kind of clever trick or technique as opposed to what you should always do.
BTW, this sounds like something you might want to do with a script (Python or Ruby, or (if you must) Perl, etc.).
Matt Gerrans
-- modified at 22:03 Friday 21st October, 2005
|
|
|
|
|
|
I have a .bmp file and I need to do it SplashScreen for my form.Anybody can tell me how to do it?
|
|
|
|
|
hi there,
I'm pretty sure that there are a lot of articles about this on CP site.
below is just one of them
Splash Screen
Hope this helps
<< >>
|
|
|
|
|
Take a look at these articles:
http://www.codeproject.com/csharp/PrettyGoodSplashScreen.asp
http://www.codersource.net/csharp_splash_screen.aspx
André
|
|
|
|
|
i make a correct cryptostream object and make the while loop that is in msn example but when i call .close() method it write correctly (i guess) the file crypted infact i can see it on my HD and it is crypted (it is a kb bigger the origina) but i get the following exception:
The lenght of the crypted file is not correct.
What does it mean? where could i wrong?
|
|
|
|
|
Hi,
Can Any one can tell How to read data from the flat files(txt files) to DataSet
Thanks and Regards,
Subbu
|
|
|
|
|
what do you mean, dataset is simple, which take string/int values , just break the file and write to dataset in the required column's, do you need a sample code.
|
|
|
|
|
use the text ole db provider.
|
|
|
|
|
Hi Everybody!
I have to make a program which works on XML files.
I need to know how to read/write in these files.
Anyone know an easy guide?
I dont need to know all about it, only how to write/read and the main notions.
Thank You
Enrico
|
|
|
|
|
go to Google.com
Search for "Xml c#"
Tons of info.
http://www.functionx.com/csharp/xml/Lesson01.htm Just one of many
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
-- modified at 13:41 Friday 21st October, 2005
|
|
|
|