|
This may be a simple question, but I am writing a program that utilizes a pictureBox to show the currently selected picture. Below the pictureBox is a "Browse..." button that calls an openFileDialog. My question is, how to i get the picture selected to appear in the pictureBox. Or i guess a better question would be how to extract the path of the selected file from the openFileDialog so i can use it as I please.
Thanks in advance for any help.
|
|
|
|
|
If you select a file in openFileDialog, you get the whole path and filename also. That means you can use :
this.pictureBox.Image = Image.FromFile(this.openFileDialog.Filename);
|
|
|
|
|
Hey there,
Is there any way to (programatically) find out the hard disk size of a computer without using WMI?
My best idea is to recurse through all the directories (externally calling dir/p) and find out how much space is taken by each directory and then adding it to the free space.
But that is quite cumbersome.
Any ideas?
-K
|
|
|
|
|
|
Actually, I like WMI a lot.
However, the application is required on an embedded system running Win XP Embedded that doesn't have WMI as a component.
-K
|
|
|
|
|
I would definately find a better solution than 'dir /p' Maybe P/Invoke?
|
|
|
|
|
can any one tell me about acelp encoding?
http://www.engineeringproject.net
|
|
|
|
|
I googled "acelp encoding"[^], and found for an example: ACELP @ VoiceAge[^].
premium1 wrote: http://www.engineeringproject.net
I don't see how this side has anything to do with it?
---
b { font-weight: normal; }
|
|
|
|
|
hey
I currently paint my form with the code:
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
<br />
paintflag = !paintflag;<br />
Graphics dc = e.Graphics;<br />
<br />
drawableWidth = dc.ClipBounds.Width;<br />
drawableHeight = dc.ClipBounds.Height;<br />
... paint here
the problem is that when only part of the form needs to be redrawn the height is wrong and it all messes up. Is there any value I can get that specifies this inner height? I've tried this.clientsize.height but the value obtained is too large.
What can I do?
thank you
dave
-- modified at 13:01 Tuesday 1st August, 2006
|
|
|
|
|
I've never done custom drawing but I think maybe PaintEventArgs.ClipRectangle contains the information you're looking for.?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
hello to you all,
i'm really interested to start and use the visual studio .net 2005 with the lang' of C# for my real-time applications. all the goodies in the C# lang' can really make me work faster but i have to know if it support real-time constrains.
is there a way to meke RT apps with C#?
or the .net framework is not RT compadable?
i really love to hear a response to this important issue.
tnx in advance,
Eli
|
|
|
|
|
C# supports multi-threading and runs fairly efficiently. The issue becomes your RT time contraint. Do you have to have a 15ms avg. response or a 15ms gauranteed response? A low average response can be achieved relatively easily with good code. However, the garbage collector will fire eventually blowing the service gaurantee if it is too low.
The only way to know for sure is to write a simple test case for your given scenario.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
hi,
RT system must have gauranteed response. i can't compromise for less.
but is the GC is the only problem of C# with deal of RT?
do you (or anyone else) know of a way to controll the GC?
tnx very much for your response...
|
|
|
|
|
The GC is the only thing specific to .NET that you need to worry about. The operating system, which you have no control as well, also dictates interrupts and schedules tasks based on thread priority. I would not design an RT system on a windows machine period unless I could accept a specific average and a large high time on response.
If you would give a better description of your RT system I would see if I can elaborate further if .NET can be applied, but no gaurantees.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Can I reference a strong-named assembly through the GUI? I tried to add it with "Add Reference", but this makes a local copy of my assembly. Should it do that? I thought putting them in the GAC eliminates this. thanx
|
|
|
|
|
Whatever is in the GAC should be in the .Net assemblies tab when adding a reference. But if you're working on the code for that strongly named assembly, it's fine to keep the project reference. When you build your installer, you can specify that you want the strongly named assemblies to go in the GAC and the rest of the assemblies to go into the install directory.
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
You have to install the strong named assembly in the assembly cashe. Then you still can reference it locally, however, if you delete it locally, your program will still work, because it will find it in the assembly cashe
|
|
|
|
|
thanx guys.. i found what the problem was: after adding it to the GAC i did a rebuild of the assembly, and i added a reference to it. but now the GAC had a different build version, so my program thought its a local one.
|
|
|
|
|
Hi All,
I have a little problem here...I know it might be easy, but I don't get it
Situation:
A Form with a DataGrid bound to a Table. This Datagrid display all datarows...perfect.
Under the Datagrid is a butoon called "New". If I click on it, a new form comes up, where I enter a new datarow and write it into the database...works perfect, the data is in the DB.
But now, the last operation of the NEW_CLICK function should be, that the DataGrid of the calling form updates, so that the new record will be seen.....and that don't work! (
Has anybody please a code-sample which explains how this is done?
Thank in advance,
Iceman571
--
I'm not the signature, I'm just grooming here
|
|
|
|
|
How are you refreshing your datagrid. Did you run through the code that binds the data again?
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
I've tried this, yes...but as you can imagine...it didn't work
|
|
|
|
|
What you can try to do is to refill your table. You are probably using the tableadapter to fill the datatable, and then you are using the datatable as the datasource to the grid. Well, if you refill your table using the adapter, it will get all the current values from the server, and sequentially display the new row in your grid.
|
|
|
|
|
Interesting...if I click a second time on my NEW Button, in the Background, the Grid gets updated...
Heres my new-click function:
private void btnSparteNew_Click(object sender, EventArgs e)
{
frmSpartenpflege f = new frmSpartenpflege();
f.Show();
this.tbl_spartenTableAdapter.Fill(this.spartenDataSet.tbl_sparten);
}
|
|
|
|
|
SOLVED!!
A stupid error...
I had to open the second from with "f.ShowDialog();"
Thanks for your help anyway...
|
|
|
|