|
I am using listview control in details view in vs2003.
Here, how i m using
foreach(DataRow dr in dtAddress.Rows)
{
ListViewItem Lv;
Lv = lvAddress.Items.Add(dr["Address"].ToString());
Lv.SubItems.Add("value for In");
Lv.SubItems.Add("value for Out");
.
.
}
View got generated like this
---------------------
StationID IN Out
---------------------
A 0 1
B 2 0
. . .
.
.
& so on, working fine.(Getting in vertical way)
But I want to show this in other way, like this.(Horizontal way)
StationID A B . .
In 0 2
Out 1 0
for this i am doing like this
int i = 0;
foreach(DataRow dr in dtAddress.Rows)
{
lvAddress.Columns.Add(dr["StationID"].ToString(), 70, HorizontalAlignment.Left);
}
I got the all station as Column Name, but how to add corresponding In, Out fields.
Thanks & regards
Humdum
|
|
|
|
|
Hi Guys,
Is it possible to create a similar sort of dialog using C#?
http://www.bartdesmet.net/images/shutdownblocking02.jpg
Although, I've been working with C# for a while, I have no idea where to get started on this.
Any help, guys?
Damn, it feels good to be back here after this while. :p ...after a year of working with Linux Scripts, Java and Oracle, I'm seriously out of touch.
|
|
|
|
|
Well, you can set the transparency key and opacity which might acheive what you want. If not you'll have to look up using Layered Windows
My current favourite word is: Nipple!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
float aspectRatio = 1280 / 1024;
Console.WriteLine(aspectRatio.ToString());
RESULT?
1
float aspectRatio = 1280 / 800;
Console.WriteLine(aspectRatio.ToString());
RESULT?
1
float aspectRatio = 1280 / 500;
Console.WriteLine(aspectRatio.ToString());
RESULT?
2
Any idea why this might be?
|
|
|
|
|
try
float aspectRatio = 1280f / 500f;
what you're doing is calculating with integers and assigning the result to float. you need to calculate with floats.
|
|
|
|
|
The compilers understands the right side expressions to be integers. You only get a decent result with float aspectRatio = (float)1280 / (float)500;
|
|
|
|
|
I see. Thanks to you both.
|
|
|
|
|
The result of an arithmetic operation on two integers is an integer. To get the float value, you must do explicit casting.
|
|
|
|
|
Hi,
You need to type cast the expression to float like the following:
float aspectRatio = (float)1280 / 1024;
MessageBox.Show(aspectRatio.ToString());
Or
float aspectRatio = (float)1280 / 500;
MessageBox.Show(aspectRatio.ToString());
This will fix the issue.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hello gurus,
I have a context menu shared by 3 controls.
Those controls are simply panels that have the same context menu.
I would like to know how I it is possible to know which panel is the owner of the context menu and called the click event.
I thought the sender parameter of the click event was the owner of the context menu but it is not. So, how can I know the owner of the context menu???
I hope my question was clear.
Thanks in advance for your answers.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
sender is the one. Have you tried casting sender to a panel instance?
Panel panel = sender as Panel;
if(panel != null)
|
|
|
|
|
I'm getting a null value.
There is no spoon.
|
|
|
|
|
Is your sender NULL or the casting failed? Step into the code and check what value sender has.
|
|
|
|
|
The casting gave me a null vaue.
That's really odd.
There is no spoon.
|
|
|
|
|
Hey guys,
Ive got a small program that communicates with an external fingerprint scanner, im using the manufacturers SDK via a dotNet wrapper. Now for this to work the DLL needs to be registered with the regsvr32 command.
Is there a way i can programmatically check that my DLL has been registered?
Thanks
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
RegistryKey clsid=Registry.ClassesRoot.OpenSubKey("CLSID");
string[] ClsIDs=clsid.GetSubKeyNames();
string subkey="";
for (int i=0; i<clsids.length;> {
subkey=ClsIDs[i];
if (subkey.Substring(0,1)!="{") continue;
RegistryKey cls=Registry.ClassesRoot.OpenSubKey("CLSID\\"+subkey+"\\InprocServer32");
if (cls==null) continue;
string x=cls.GetValue("","").ToString();
}
|
|
|
|
|
If it isn't, Activator.CreateInstance will throw an exception when you try to create an instance of a class from the COM library. There can be other reasons for the exception of course, so if you want to make sure it's the dll not being registered, you can check whether the registry key HKEY_CLASSES_ROOT\FullClassName is there (FullClassName being the string you pass to Activator.CreateInstance).
|
|
|
|
|
Hello everyone,
When we call a remote web services in an asynchronous way, we could return the invocation immediately and later we could either call Endxxx or our suppied callback will be invoked when the asynchronous call result is ready.
My question is, how will the result be delivered to client?
- Does the proxy on client side opens a port and listen to the return SOAP message containing the result?
- Does the client use keep alive technique and keeps the Http connection open/live from the beginning (when we call BeginXXX to invoke the web services) to the end (when the result is ready) -- if implemented in this way, there is no need for the client to open a port to listen?
- Or implemented in some other ways?
thanks in advance,
George
|
|
|
|
|
George_George wrote: My question is, how will the result be delivered to client?
As SOAP message.
George_George wrote: Does the proxy on client side opens a port and listen to the return SOAP message containing the result?
Communication is done using HTTP/HTTPS. So the port is 80 and proxy won't open it.
|
|
|
|
|
Thanks Christian,
So, how do you think asynchronous call is implemented especially when deliver results to client side and invoke callback at client side?
- Does the client (proxy) keep connection alive from beginning (when call BeginXXX) to end (when asynchronous callback is called)?
- or client continue to poll the result and retrive result from server side when it is ready?
- or something else?
regards,
George
|
|
|
|
|
Hey, I have successfully used Flash.ocx control in C# to play SWF movie file but I m facing some limitations in it. I jumped to any specific frameNo by using gotoframe() method given in this control, It do jumped but the problem arise when I try to jump on frame which is greater than 12,500 i.e: It only understands starting 12,500 frames of the movie although it do play frame grater than 12,500 but the problem is to jump. Do anyone has idea about this problem.
Plus I also want to play the movie at 1/2X,2X,4X,... speed, Is it possible using this control or I should look for another and what should that ANOTHER(remember I need it on windows form).
regards.
|
|
|
|
|
Hello All,
I have an MFC based MDI application (.exe) in which we created OLE
layer such that the application can be easily accessed by MS Excel and invoke
some of its properties.
Now we have a use case such as C# based DLL should be able to access this
already running MFC based application and invoke its properties or try to get
some data from the MFC application. Note C# DLL and MFC application are two
individual different processes. The C# DLL is being invoked by the MFC app it self. I think it should be a problem if the C# DLL is launched by MFC or its been invoked independently in either case i am looking for communication between these two.
Any suggestions in this.
thanks
|
|
|
|
|
venkyhyd wrote: I think it should be a problem if the C# DLL is launched by MFC or its been invoked independently in either case i am looking for communication between these two.
"I think it should NOT be a probelm if the C# DLL is launched by MFC or its been invoked independently in either case i am looking for communication between these two."
|
|
|
|
|
|
Hey folks,
I've been pulling my hair out on this one. I've got a data table that's created within the constructor for Form A (the child form). Now, this form is created from a button in Form B (the parent form), and can be done so multiple times simultaneously. I'm experiencing a peculiar problem where although Form A SEEMS to close fine (in the sense that it is fully destructed), the data table that was instantiated in that form wasn't disposed. I know this because I have a MessageBox.Show() within the constructor of Form A which displays some values from the data table. Each time the method is called, I'll have multiple message boxes depending on how many times I have opened Form A (regardless of how many times I've closed it!).
I've tried calling the dataTable.Dispose() method in the event handler for the closing of Form A and still this seems to do nothing.
I've no idea what's wrong .
Any help is much appreciated.
|
|
|
|