|
You are correct, if I call Invalidate and Refresh that will cause OnDrawItem(DrawItemEventArgs ea) to execute. However, even if the dropdown area is show, ea.Index is always -1. If there are 5 items in the ComboBox, I would expect OnDrawItem(DrawItemEventArgs ea) to be called 5 times, one for each item. However, that is not the case. Can I somehow invalidate and/or refresh the individual items instead?
|
|
|
|
|
arnold_w wrote: Can I somehow invalidate and/or refresh the individual items instead?
I dont think so, I cant think of any hack ideas either.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Ok, thanks for your posts.
|
|
|
|
|
Can you pass true to the invalidate method to invalidate all children?
Simon
|
|
|
|
|
I just tried it, it doesn't make a difference. Thanks anyway for your suggestions.
|
|
|
|
|
Sorry, it was just a guess, I'm surprised it doesn't work. That's what the invalidate/refresh methods are for.
Simon
|
|
|
|
|
Hehe, my hacks was leaning towards invalidating only a specific region, but that would be real bad
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Good Morning
i have written something to kill a Process based on the Supplied parameter. Here is the Code
I created a Class that will Contain my Function like this
namespace Process_Killer
{
public class Process_Killer
{
public bool FindAndKillProcess(String name)
{
Boolean Bolres = false;
Process clsProcess = new Process();
if (clsProcess.ProcessName.Contains(name))
{
clsProcess.Kill();
Bolres = true;
}
else
{
Bolres = false;
}
return Bolres;
}
}
}
And after that i have a Win App , that will pass the name of the Process and in the kill button am calling the function that i created above like this
Boolean Bolres = false;
String Processname = txtProcessname.Text;
Process_Killer objProcesskiller = new Process_Killer();
Bolres = objProcesskiller.FindAndKillProcess(Processname);
if (Bolres == true)
{
MessageBox.Show("Process Killed", "Process Killer");
}
else
{
MessageBox.Show("Process not Found, Do not include the Process Extension", "Process Killer");
}
And when i run this app , i get the Error
No process is associated with this object.
Thank you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You are creating a new process, and then checking if it's name is the one you are looking for. It won't be, you just created it.
You need to be using System.Diagnostics.Process.GetProcessesByName(processName); to find the process with the name you want to kill.
Simon
|
|
|
|
|
Thank you it
It worked
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I post this a C# newbie - please bear with me
I have coded a small project in C#, and ran into a problem illustrated in the below minimal project cs file.
CODE
---------------------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static int ScanProgress
{
set
{
progressBar1.Value = value; // Error: An object reference is required for the non-static field, method, or property 'WindowsFormsApplication1.Form1.progressBar1' ...
}
}
}
public static class AnotherClass
{
public static void SetScanProgress(int Value)
{
WindowsFormsApplication1.Form1.ScanProgress = 17;
}
}
}
---------------------------------
/CODE
I get the error when I refer to the non-static progress bar in the set method?
I would like to be able to do something like this, to show the progress of a scanner from a callback function, in the main GUI.
Or more general - how do I alter the Main GUI from another class/object?
Thanks,
munk
|
|
|
|
|
You method is static. You cant refer to instance variables.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I now understand that this can not be done like this.
BUT THEN - how can I access a property of a (design time) component (like a progress bar "bar.Value") on the main form from another class?
This is e.g. to display tha scanning progress of a camera from a camera callback function.
Thanks,
Thanks,
munk
|
|
|
|
|
This is my requirement.
I am allowed to use a DGV (or a List View or some other control that can be used in tabular form).
Then, I have a set of labels/text boxes that are created in runtime according to some data from a DB. Let's say just text tabels.
So I need to drag and drop contents of these run time generated textboxes/labels onto any preferred cell in the DGV (or that any other control). When that is done, I need to be able to delete/destroy the original label as well.
On the other hand, if the user decides to take some data from the DGV and put them back in the original labels, that should also be possible. SO I guess those labels/textboxes need to be put inside of some kind of a control.
But I'm relatively new to C#, so haven't got much of an idea so as to how to do this. I could get text on labels to be copied to another lables, but when I used a DGV I got stuck.
Main reason being, when an item is dragged onto the DGV, there seems to be no event to detect on which cell the mouse is. The Mouse_Enter method works only for simple mouse enter movements - not when dragging.
PLEASE HELP!
|
|
|
|
|
hi friends
can i create Iphone application in .NetFrameWork? i want application similar to Device application of PDA. any link about tutorial site and Sample Source Code.
I search a lot but there is sample about web application i did not get any help about Iphone application which install on Iphone.
Note: i knew this is wrong forum for this Question but just say Sorry.
I also Knew One another Answere Google but i try too much???
wasim khan
|
|
|
|
|
I doubt you can use the .NET Framework on the iPhone. You'd have to use C or Java I'm guessing.
Have a word with Christian Graus, or maybe not , he's been writing iPhone applications and hating every minute of it.
|
|
|
|
|
Ok Thanx about ur kind replay i will contact CG
wasim khan
|
|
|
|
|
I believe that the standard language is Objective C[^].
Although, like Ed said, I'm sure you'll be able to use Java. (I remember reading about Sun saying they were writing a JVM for the IPhone a few months ago)
Good luck though, I've only heard complaints about it being awkward to do. (Mainly from CG)
Simon
|
|
|
|
|
Hello world!
How to change my Local IP, default gateway, Preferred DNS server, Alternate DNS server with C# codes?
TanX World...
if(Human.live)
{
Human.peaceful = false;
while(true)
{
Human.love(Human girl, Human Boy);
}
}
|
|
|
|
|
|
How to Implement Context-Sensitive Help in .NET Applications Created with C#,
|
|
|
|
|
|
i'm just wondering if there is a straight-forward xmlrpc library in the .net compact framework and if so, anybody has any experience with it?
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
I think this library[^] is about as basic as it gets from what I remember (without writing your own).
|
|
|
|
|
Hi,
I'm currently developing a c# windows application program which allows me to crop certain part of the image when i select it. But if I got a bigger image than the currently picturebox height and width(e.g. picturebox size(400,300) Image opened size(700,300), I tried to use the StretchedImage property to make it fit into the picturebox but when i crop it crops the original size of the image not the image in the picturebox when I use
Bitmap previewImg = newImg.Clone(rect, initialImg.PixelFormat);
my rect is the rectangle that i selected using Mouse Down and Mouse Up events. Hope I could get some help on this thanks =)..
|
|
|
|