|
I am currently trying to get a combo box to select by default a value that I have recieved in a constructor from another form. I have tried everything that I can think of. I am sorry I feel like this is one of those easy questions but just cannot find the answer. If any one has any suggestions I would be greatly appreciated.
Thanks
Corey Embry
at first I tried this
ItemLoc = cbxManufacturer.FindString(MfgName);
cbxManufacturer.SelectedIndex = ItemLoc;
Then I tried this
cbxManufacturer.SelectedItem = MfgName;
then I tried this
cbxManufacturer.SelectedText = MfgName;
and finally I tried this
cbxManufacturer.SelectedValue = "2";
I am just plain out of ideas so if anyone can help I would be very greatful.
|
|
|
|
|
Corey Embry wrote:
ItemLoc = cbxManufacturer.FindString(MfgName);
cbxManufacturer.SelectedIndex = ItemLoc;
This should work, MSDN even has this as an example. Are you sure both MfgName and ItemLoc are valid?
|
|
|
|
|
ItemLoc is not being populated with a correct value MfgName is correct from a dropdownlist on a pervious screen however when I run it against this dropdown it will not sync it gives 0xffffffff location eventhough the text is contained in the drop down list.
|
|
|
|
|
Hi , ive just installed vs.net 2003
and im about to create a c# win app for pocket pc.
the problem is , that my app needs to be connected to the internet ,
so does anyone have any idea how to make the pocket pc EMULATOR think that it is online or connected to our network???
and humm , maybe this wasnt the correct forum (?)
//Roger
|
|
|
|
|
That's what the loopback adapter[^] is for IMHO.
|
|
|
|
|
no its not (?)
what do i need to do on the emulator to be able to connect it?
no network settings sticks , it drops everything every time its started
is there anyone who have actually done this?
//Roger
|
|
|
|
|
What does this error means?
An object reference is required for the nonstatic field, method, or property 'istatistik.Form1.process()'
Thanx in advance...
|
|
|
|
|
it means you are trying to call the function "process" which is only accessable if you create an instance of the object - prob Form1
Form1 form = new Form1();<br />
form.process();
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
How do I set an auto recovery for an Windows NT Service?
I want to restart the service automatically when it fails for some reason.
In Administrative Tools->Services-> select a service and see "Recovery" proterty tab.
There are ways to "restart the service" after failures.
How do I do it programatically?
Any Idea. A solution in C# or VB will be ideal, but C++ will also do.
I could n't find a way to do this.
Heelp !!!
Swarup Das
|
|
|
|
|
when i add a child form in an mdi form; and when i try to resize the mdi form scrollbars appears horizontally and vertically, i tried to vanish these autoscroll bars but i coudnt find the right property....
can anyone give me a suggestion?
|
|
|
|
|
[C# Windows Application]
When I make reportform that use .Net CrystalReport Component,
Should I do Create Designed DataSet(Support DataBase Schema) so that We use Drag-and-Drop Fields in Field Expoler?
What method do I make reportform use Drag-And-Drop in Field Expoler without creating Design Type DataSet?
|
|
|
|
|
Two questions.(dummy)
1. If there are number of namespaces included in a project, how to know which namespaces are used?
2. Is there any overhead if I referenced namespace and but not called any of the types included in that namespace?
Don't and drive.
|
|
|
|
|
Kant wrote:
1. If there are number of namespaces included in a project, how to know which namespaces are used?
If they're your namespaces that you created, pop open the object browser or Reflector[^]
If they're namespaces from the Framework, then you can look at the metadata in ILDASM or Reflector. To do it in Reflector, pop open the Assembly and click on the References item.
Kant wrote:
2. Is there any overhead if I referenced namespace and but not called any of the types included in that namespace?
IIRC, no. Because the Compiler optimizes away the unused namespaces. However, why reference a namespace that you aren't going to use?
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
David Stone wrote:
why reference a namespace that you aren't going to use?
Actually I need to change the code and the developer who wrote it, is gone. For a person like me whose experience is in C++/MFC, the C# code looks like greek to me.
Thx for the Reflector tip.
Don't and drive.
|
|
|
|
|
Namespaces are just ways of giving classes long names. So, when you write:
namespace utility
{
class Test
{
{
}
You're really just creating a class named utility.Test.
The unit of physical organization is the assembly, which sometimes map to specific namespaces, sometimes contain more than one namespace, and sometimes contain only part of a namespace.
The answer to #2 WRT assemblies is "no", there is no overhead if you reference an assembly but don't use anything from it.
|
|
|
|
|
Hello..
I used Crystal Report which was Visual Studio .net included.
And, I'd like to make some rpt file in Runtime, not Design Time.. you know!!
However, I don't know How to deal Crystal Report in Runtime..
Is there anybody to help me?
Thanks..
I'm not who I was
|
|
|
|
|
Hi all
how to change column's header text in datagrid ??
|
|
|
|
|
DataGrid1.Columns[0].HeaderText = "FirstName";
DataGrid1.Columns[1].HeaderText = "LastName";
Alexander German
|
|
|
|
|
sorry, forgot to add, that i am talking about windows.forms datagrid, not asp.net one
in winforms u dont have columns property,
header text is set via column styles, but dont know how to get them after setting styles
|
|
|
|
|
|
Thanks Kant.
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Hi. What's the difference between CInt(), Int32.Parse() and Convert.ToInt32() ? It looks to me that all of them are used to convert other data types to integer. So what's the difference?
|
|
|
|
|
CInt is a VB.NET thing...so I wouldn't touch that.
Convert.ToInt32() looks like this:
public static int ToInt32(double value) {
int local0;
double local1;
int local2;
double local3;
if (value >= 0) {
if (value >= 2.14748e+009)
goto i1;
local0 = (int) value;
local1 = value - (double) local0;
if (local1 > 0.5 || local1 == 0.5 && local0 & 1 != 0)
local0++;
return local0;
}
if (value >= -2.14748e+009) {
local2 = (int) value;
local3 = value - (double) local2;
if (local3 < -0.5 || local3 == -0.5 && local2 & 1 != 0)
local2 = local2 - 1;
return local2;
}
i1: throw new OverflowException(Environment.GetResourceString("Overflow_Int32"));
}
Int32.Parse() looks like this:
public static int Parse(string s) {
return Int32.Parse(s, 7, null);
}
public static int Parse(string s, NumberStyles style, IFormatProvider provider) {
NumberFormatInfo local0;
local0 = NumberFormatInfo.GetInstance(provider);
NumberFormatInfo.ValidateParseStyle(style);
return Number.ParseInt32(s, style, local0);
}
And Number.ParseInt32 is an extern method that calls into the CLR itself.
So, the Convert class does a lot of math checking and stuff like that. The Int32 implementation calls into the core of the CLR. So you may want to do some timer work to find out what is the fastest implementation.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Hey, .NET source code!
Where can I get it?
Thanks,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Alvaro Mendez wrote:
Where can I get it?
Check out :Anakrino[^], or you could always try to read ILDasm.exe output.
-Nick Parker
|
|
|
|