|
right... I just found it just before you repled.
This is what I wrote... I may be wrong... pls correct me...
code shown below:
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace UManager_Interpeter
{
static class Program
{
// <summary>
// The main entry point for the application.
// </summary>
[STAThread]
static void Main(string[] fileList)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run();
foreach (string file in fileList)
{
MessageBox.Show(file + " was dropped into app!");
}
}
}
}
|
|
|
|
|
P.S. How do I get the Main() pickup the name of files that I drag & dropped into app?
|
|
|
|
|
Blubbo wrote: P.S. How do I get the Main() pickup the name of files that I drag & dropped into app?
I don't understand "pickup the name of files". They are in the args array if the user dropped them on the Applications Icon in Windows Explorer.
class Program
{
static int Main(string[] args)
{
led mike
|
|
|
|
|
AAAAHH!!! Solved!!!!
Thanks a heap! You have answered my question... I knew I had to put strings[] in Main() but didn't come out right.
That was until I noticed... "static class Program"
I HAD to remove "static" to get it to work.
I had like that when I wrote it before.
Again thanks a heap!
|
|
|
|
|
I'm using MS WinForms ReportViewer control in local mode.
My application creates in-memory assembly EntityExtension dynamically.
Report definition refers codemodule Business which references to this assembly:
<CodeModule>EntityExtension</CodeModule>
<CodeModule>Business</CodeModule>
For running ReportViewer I use:
reportViewer1.LocalReport.ExecuteReportInCurrentAppDomain(<br />
System.Reflection.Assembly.GetExecutingAssembly().Evidence);<br />
<br />
reportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("EntityExtension");<br />
reportViewer1.LocalReport.AddTrustedCodeModuleInCurrentAppDomain("Business");
Trying to preview report causes error
An error occured during local report processing
[BC30007] Reference required to assembly EntityExtension
How to fix ?
How to force ReportViewer to find EntityExtension assemnly ?
Andrus
|
|
|
|
|
I have a picturebox which was created programatically and its location should be determined when the form loads.
I set the location property to a point but no matter what point is set, the picturebox appears on a fixed location when the form loads.
Below is the code:
<br />
In the picture class:<br />
<br />
public PictureBox PlaceFlower()<br />
{<br />
PictureBox flower = new PictureBox();<br />
flower.Height = 80;<br />
flower.Width = 80;<br />
flower.Image = Image.FromFile("C:\\grass.bmp");<br />
<br />
return flower;<br />
}<br />
<br />
public Point SetCoordinates()<br />
{<br />
int x = randomClass.Next(10,50);<br />
int y = randomClass.Netxt(10,50);<br />
Point p = new Point(x, y);<br />
<br />
return p;<br />
}<br />
<br />
<br />
In the form class:<br />
<br />
private PictureBox flowerPicture;<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
flowerPicture = picture.PlaceFlower();<br />
flowerPicture.Location = picture.SetCoordinates();<br />
}<br />
<br />
I've checked the values of the point coordinates and they vary each time the form loads but somehow the picturebox always remain fixed at the same point on the form. I have made sure that the locked property of the control is set to false.
What is the problem with the picturebox location?
|
|
|
|
|
Hi,
some comments:
1.
your names are quite confusing, you should change them:
PlaceFlower() does not place a flower, it creates a PictureBox that holds a flower,
but it does not make it visible and does not set its location; GetFlowerBox() is a better name.
SetCoordinates() does not set coordinates, it creates and returns a Point, but does
not do anything with the Point. GetRandomPoint() would be a more appropriate name.
Choosing proper names will help you in understanding your own code, today and in future.
2.
your code is not complete, and the problem is likely to reside it what is not shown.
My best guess is you have two PictureBoxes:
- if you already see a flower, it is not the one from flowerPicture; I suspect you
have some other PictureBox that shows the flower you see, and is not affected by
your attempts to move it;
- the flowerPicture PictureBox, as far as the code shows, never becomes visible, since
it is not added to the Controls property of any Container or Form.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Yup, I guess you are right. When I added the control to the form, it can work now. Thanks~
|
|
|
|
|
Hi, I have an application that was coded in VS 2003 (C#) and converted to 2008. Most everything is working fine however, I have one annoyance. When the applicaiton is run the buttons and controls maintain the squared off edges that were present in VS 2003 (this is fine); however, on my machine when I load a form in the designer I see the newer rounded (and smaller) controls. So when I am making UI changes I don't get to see how things are really going to look until I run the application. Is there a setting somewhere that I need to change for this? There are 2 of us who are coding on this project and the other coder doesn't have this issue. He sees the controls with the older style in both desing and runtime. Any help would be greatly appreciated.
Oh by the way, we are compiling to .net 2.0
Regards,
Sean
|
|
|
|
|
try and see that Application.EnableVisualStyles(); is executed in Main() before you run your form. Had the same problem before, noticed that the styles weren't enabled and it was painting the old 'square' button look.
|
|
|
|
|
HI,
I'm Tring to Usae the :
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");
And
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_TemperatureProbe");
But I Do Not Get Any Resaults
ANYONE?
is there another way to Get The CPU temperature
Have Fun
Never forget it
|
|
|
|
|
Manufacturers are not expected to provide WMI data providers for everything they make. You' not getting any results because either you did not install the WMI providers supplied with your motherboard or they simply don't exist. If they don't exist, you can't use WMI to get the CPU temp.
|
|
|
|
|
AH O.K,
So Waht i need is to find if my M.B Supports WMI Data and have the Driver
THANKS
Have Fun
Never forget it
|
|
|
|
|
Da how can I see the details of an assembly ( dll or exe)
I tried in notepad…
Do we have any method to list out the methods declared in the assembly?
My small attempt...
|
|
|
|
|
use the Lutz Roeder .net reflector or add the assembly to project visual studio or/and use object browser to explore its contents or
....
f(yf) = yf
|
|
|
|
|
Hi All,
I have some foreach loops like this:
foreach(Datarow Head in mydt.Rows)<br />
{<br />
foreach(Datarow Sub1 in mydt1.Rows)<br />
{<br />
}<br />
<br />
foreach(Datarow Sub2 in mydt2.Rows)<br />
{<br />
}<br />
}
Now what should i use that when my condition within foreach(Datarow Sub2 in mydt2.Rows) is true , my programe most go back and continue the begin foreach: foreach(Datarow Head in mydt.Rows)
Thanx.
|
|
|
|
|
I think the word you are looking for is
break;
Just do this:
if(someCondition.IsMet)
{
break;
}
Simon
|
|
|
|
|
use exit , continue , break .improvise. and never modify the collection while you are in the loop
f(yf) = yf
|
|
|
|
|
i tested continue, return, break. None of those gives me the right output
|
|
|
|
|
As Simon said break; should do it.
if you are in a loop and you have hit your required condition "break" will exit the current loop. (or better re-design\refactor your code so you dont have so many loops)
modified on Wednesday, April 2, 2008 10:58 AM
|
|
|
|
|
Try the following example based on the code structure you gave:
int[] mydt = new int[] { 2, 0, 1 };
object[] mydt1 = new object[] { new string[] { "Aa", "Ab", "Ac" }, new string[] { "Ba", "Bb", "Bc" }, new string[] { "Ca", "Cb", "Cc" } };
object[] mydt2 = new object[] { new string[] { "Aa", "Ax", "Ac" }, new string[] { "Ba", "Bb", "Bx" }, new string[] { "Cx", "Cb", "Cc" } };
foreach ( int Head in mydt )
{
Console.WriteLine("Head = {0}", Head);
string[] mydt1Rows = (string[])mydt1[Head];
foreach ( string Sub1 in mydt1Rows )
{
Console.WriteLine(" Sub1 = {0}", Sub1);
}
string[] mydt2Rows = (string[])mydt2[Head];
foreach ( string Sub2 in mydt2Rows )
{
Console.WriteLine(" Sub2 = {0}", Sub2);
if ( Sub2.IndexOf("x") != -1 )
{
Console.WriteLine(" break: in order to skip to next Head");
break;
}
}
}
It should give you
Head = 2
Sub1 = Ca
Sub1 = Cb
Sub1 = Cc
Sub2 = Cx
break: in order to skip to next Head
Head = 0
Sub1 = Aa
Sub1 = Ab
Sub1 = Ac
Sub2 = Aa
Sub2 = Ax
break: in order to skip to next Head
Head = 1
Sub1 = Ba
Sub1 = Bb
Sub1 = Bc
Sub2 = Ba
Sub2 = Bb
Sub2 = Bx
break: in order to skip to next Head
showing that the break is properly ending the inner Sub2 loop when the condition occurs (Sub2 contains 'x').
Clive Pottinger
Victoria, BC
|
|
|
|
|
I am novice to DB operations. I had some question.
In a DB there are 3 tables Company, Customer, Contact.
Company feilds: Cid, CName,
Customer feilds: custID, custName, Cid(same as company), etc......
Contact feilds: conID, conName, custID(same as customer), etc.....
This approach i m using:
1) loading the company table on form_load event, and binding CName to combobox.
2) On combBox Selection_change_commited event loading data from Customer table where Cid is same. After filling the DataTable calling the BindCust method to bind data.
===Here i m facing a problem, when 1 selects the name from cmbBox, the corresponding feilds of Customers table loads only for 1st tym. If i select name 2nd tym the data remain unchange. what is wrong?
I also use cmbBox selection_change event, in this data is not loading at all.
3) then i create a currency manager of Customer datatable, on the cm_Position_change event i am loading contact table and after that calling BindContact method.
Plz, guide me.
a) Is this approach is Ok?
b) If not. then plz tell/guide me, how to acheive the same.
I want
If user selects a Name from cmbBox, then all customers that name appears,
then against this customer all contacts details appears.
Thanks to all.
|
|
|
|
|
Is there no standard tree structure supplied with .Net? If not, any recommendations on a third party one?
|
|
|
|
|
Do you mean TreeView, or a hierarchical structure of items? If the hierarchical structure then I have one knocking around somewhere you can have. Let me hunt it out and you can have a copy - I'll probably post it on my blog.
|
|
|
|
|
The "hierarchical structure of items" one
|
|
|
|