|
I wanna write all the args into a textBox in the main Form (Form1)
|
|
|
|
|
Oh I didnt see tje reply where you wrote that it has to be static, now it works, tnx!!!
|
|
|
|
|
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new myForm(args));
}
public class myForm : Form {
public myForm(string[] args)
{
InitializeComponent();
if (args != null && args.Length > 0)
{
for (int i = 0; i < args.Length; i++)
{
this.txt.Text += args[i];
}
}
}
private myForm()
{
InitializeComponent();
}
}
|
|
|
|
|
I'm trying to create a custom datagrid column that is populated with values from any enumerated type passed when the object is constructed.
I pass in the type like this:
<code>
public DataGridEnumDropdownColumn( Type enumType )
</code>
The type is used to populate the dropdown list.
In the overridden Edit method of the DataGridColumnStyle I want to set the selected value of the combo box.
The code I have so far (shown below) retrieves the value of the column (the value of the enum) but I'm unable to cast it to the enumerated type.
<code>
object colValue = GetColumnValueAtRow( source, Rownum);
Combo.SelectedValue = (?????)colValue;
</code>
Any help would be greatly appreciated.
|
|
|
|
|
I am doing something similar. Try something like this:
mComboBox.SelectedIndex = (Int32)m_oCurSelItem.QstType;
Hope it helps.
|
|
|
|
|
<enum type> type = <enum type>.<default value>;
try
{
typeFromDb = int.Parse(<raw value read from the database>.ToString());
if (Enum.IsDefined(typeof( <enum type> ), typeFromDb))
type = ( <enum type> )typeFromDb;
}
catch {}
|
|
|
|
|
That's very interesting... I'll give that a try.
|
|
|
|
|
just realised i copied the bit of code from net 1.1 project. in net 2.0 you can get away without using try/catch for it is rather expensive and use int.TryParse() method...
the reason behind the whole thing is that you verify that the database values are within your enum , otherwise you may have injected values which just aren't defined...
|
|
|
|
|
Thanks for your input guys. This is how I finally managed to get it working:
object colValue = GetColumnValueAtRow(Source, Rownum);
string colText = Enum.GetName( this.enumType, colValue );
Combo.SelectedItem = Enum.Parse( this.enumType, colText );
|
|
|
|
|
i have a question about making scripting language with C#.
for example, if i have a richTextBox, and i write there:
<br />
a = 1;<br />
while (a < 10)<br />
{<br />
return "abc";<br />
}<br />
(something like that.)
that return me 10 times "abc" on richTextBox.
there is some way to do it?
thanks.
|
|
|
|
|
|
Have a look at my article, it's one of the few that I've come across that deals with .NET 2 if your interested.
Ed
|
|
|
|
|
Hi there.
I have a scenario where I want the user to click on a picturebox, move the mouse and release the click....so that he could select a portion of the image. Now...I want to draw a dotted frame so that the user would know where he has selected.
Can anybody help out on this, even a link/article is helpful.
Thanks.
"I came back from death to make the wrong things right again." - Eric Draven (The Crow)
|
|
|
|
|
|
i've read that the NotifyIcon class in .Net 2.0 can display balloon tooltips. Even after installing .Net 2.0, I haven't been able to do so. When i place a NotifyIcon component on my form and then begin typing the code, the method isn;t listed. How do i go about this?
|
|
|
|
|
Does ShowBalloonTip() not appear in the Intellisense dropdown? See here[^].
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
No it doesnt show me the method. Is this because when I click the Help>>About box in Visual Studio 2003, it shows me .Net framework 1.1? How do I get it to use .Net framework 2.0?
|
|
|
|
|
As far as I'm aware there's no way to get VS2003 to use .NET 2.0 - you'll need to upgrade to VS2005 or you one of the Express editions for an MS solution or one of the other IDE offerings that are out there - eg xacc.
Dave
|
|
|
|
|
Mridang Agarwal wrote: How do I get it to use .Net framework 2.0?
You'll need to upgrade to VS 2005. I think you can install an "Express" variant for free (for 1 yr).
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
If you are using VS 2003, then your app will use .NET 1.x. There are several articles here in CP that implement balloon tooltips, some of them very good.
You could try searching[^]
(The articles by Peter Rilling and Joel Matthias look very good)
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
Is there a way to use a C DLL to use in a C# Application?
- A programmer's national anthem; "AAAAAHHHHH!!!!"
|
|
|
|
|
|
Does PInvoke work if a create a DLL in any other language too e.g. Delphi?
|
|
|
|
|
Good question, I've never tried before. My guess is, as long as one can export the native methods so that they're visible to C, then yes.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
hi to all,
how can i upload a file from my client(computer) to the server ?
i tried the code below but it gives this error :
"Remote server returned an error (405) : Method not allowed".
WebClient oWebClient = new WebClient();
oWebClient.UploadFile("http://srvdev/philae_edition/TestCompta.txt", "c:\temp\TestCompta.txt");
oWebClient = null;
any ideas ?
best regards and thanks in advance
fady
|
|
|
|