|
DropDownStyle is already set to DropDownList. If the user doesn't select any of the items (he/she clicks outside the ComboBox after he/she has "touched" ComboBox) then I don't get ComboBox_SelectedIndexChanged or ComboBox_SelectionChangeCommitted events. It seems those events are only fired when a selection is made inside the ComboBox.
|
|
|
|
|
That's why I said "If you combine that with handling the DropDown event..."
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Ok, I understand:
private void comboBox_DropDown(object sender, EventArgs e)
{
if (((ComboBox)sender).SelectedIndex < 0)
{
((ComboBox)sender).SelectedIndex = 0;
}
}
Very good idea, that works great! Thanks!
|
|
|
|
|
That's the event!
You're welcome!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
i have created a dll file that include user control with panel on it ,when i add this dll to my tool box i can only have access to user control and not the panel ! while i need to drag n drop a picture box into it ! plz help me on this .
i just want to do it on design time not programitically!
|
|
|
|
|
Start here[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have been trying to start multiple instances of iexplore and other
apps then get the handle so i can reposition it and other actions.
It works great in Windows 7 using myProcess.Id to find the process and retrieve the MainWindowHandle. It also works in Windows 8.1 if there is
only 1 instance of the application running.
The Problem: When i get more than one instance of the app open in W8.1 I can not find the handle. I can get the process id but can't get the handle even by looping through all processes and looking for the handle.
Help
|
|
|
|
|
RRLCoder wrote: I can get the process id but can't get the handle Can you post a SMALL examle that reproduces this problem?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
This is a bit long but shows most of what i've tried
string ProcToStart = "iexplore";
int saveProcId;
Process myProcess = new Process();
myProcess.StartInfo.FileName = TargetFile;
myProcess.StartInfo.Arguments = TargetArguments;
myProcess.StartInfo.UseShellExecute = true;
myProcess.Start();
saveProcId = myProcess.Id;
1-the simple approach, just trying to access myProcess.MainWindowHandle gets 0 even after a 10 min sleep
2--here is one method looping through all processes
I also tried this wraped in: while (proc.MainWindowHandle == IntPtr.Zero) (ran forever & didnt find a hit)....
foreach (Process proc in Process.GetProcesses())
{
if (proc.Id == saveProcId)
{
Console.WriteLine(" PID: " + proc.Id + " Handle: " + proc.MainWindowHandle);
}
}
3--Here is another attempt using ....GetProcessById
try
{
ChosenProc = Process.GetProcessById(ProcId);
Console.WriteLine("Your Process Info: " );
Console.WriteLine(" Id: " + ChosenProc.Id
+ " Handle: " + ChosenProc.Handle
+ " MainWinHndl: " + ChosenProc.MainWindowHandle
+ " Name: " + ChosenProc.ProcessName);
return true;
}
catch
{
ChosenProc = null;
Console.WriteLine("Incorrect entry.");
return false;
}
|
|
|
|
|
RRLCoder wrote: This is a bit long but shows most of what i've tried InvalidOperationException? Try using the full path to the application;
Process myProcess = new Process();
myProcess.StartInfo.FileName = @"C:\Program Files\Internet Explorer\iexplore.exe";
myProcess.StartInfo.Arguments = @"http://www.codeproject.com";
myProcess.Start();
Console.WriteLine(myProcess.Id);
Console.ReadLine();
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks...
I just tried it both ways (fully qualified and just the iexplore) followed by:
Console.WriteLine("IE Instance started... PID= " + myProc.Id + myProc.MainWindowHandle);
I get an unhandled exception on the myProcess.MainWindowHandle no matter how much of a sleep or if i loop looking for the process id. Again, it works find if there is only 1 instance of the target app (iexplor in this case) open.
|
|
|
|
|
I run an indoor sports facility.
Our receptionist uses some media player for background music in our foyer.
What I need is a way to mute that media player, to play my own .wav file to remind players to be ready 10 minutes before events start, (triggered by system time) then resume the background media player.
If that makes sense?
My application is in C# and uses AXVLC.
Im also considering making it a Service instead, so the receptionist doesnt close it.
|
|
|
|
|
Uhm what is your question, does it make sense, yes. There aeems to be plenty of support for this process on Google.
I would not make it a service, what happens if you want to interrupt the announcement or make an adhoc announcement. You actually need a PA system and should probably look around for a package before attempting to build your own (this assumes you are into running the sports centre and are not a developer).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I've been a hobbyist developer for much longer than I've been working at the centre. But theyve just made me a manager, so now looking at making some cool new toys. We've got a PA system, but I want to make things as automated as possible as Im getting busy doing other things.
|
|
|
|
|
el_stupey wrote: Im also considering making it a Service instead, so the receptionist doesnt close it. That's not what a service is for; and yes, the user can close services. Using services also introduces a new problem - they usually run under a system-account, and should not be messing with the users' desk.
Simplest solution; get a list of MP3's to play. Play them yourself (from code), then it becomes quite easy to interrupt the song at a predefined time and to play "something else".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Maybe a service isnt what I need. Was just a thought.
Thanks for the suggestion, I might try that out.
Also found another answer here. Only problem with that is it claims win7 and later which means finally upgrade from vista.
|
|
|
|
|
how to edit in crystal report
|
|
|
|
|
Reports are effectively read-only views of your data and should not be used for editing the data
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Edit what exactly? The criteria?
Can you edit your question please, it isn't clear.
|
|
|
|
|
|
IIRC you can add comments to a report, not the same as editing which is not possible.
I might be completely wrong as I have not used that pile of crap for over a decade. One of the worst apps even inflicted on the development community.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
What do you mean exactly ?
Usually you work from a template and assign data to it, either by passing parameters so the report generates itself or by passing a datasource.
So do you want to change the template or the generated report itself.
In case of the former, to do it properly you'll need the crystal reports editor application (VS is limited).
In case of the latter, please define better what you want to achieve, because that's not entirely the purpose of Crystal Reports.
|
|
|
|
|
i have developed a small win apps which is suppose to capture skype conversation. my main concern is that i have define the
WndProc() here is the code a bit
protected override void WndProc(ref Message m)
{
Boolean handled = false;
if (m.Msg == NativeCalls.APIAttach && (uint) m.LParam == NativeCalls.SKYPECONTROLAPI_ATTACH_SUCCESS)
{
NativeCalls.HWND_BROADCAST = m.WParam;
handled = true;
m.Result = new IntPtr(1);
}
if (m.Msg == NativeCalls.WM_COPYDATA && m.WParam == NativeCalls.HWND_BROADCAST)
{
COPYDATASTRUCT data = (COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam, typeof(COPYDATASTRUCT));
StatusTextBox.Items.Add(data.lpData + Environment.NewLine);
IsCallInProgress(data.lpData);
handled = true;
m.Result = new IntPtr(1);
}
m.Result = IntPtr.Zero;
if (handled) DefWndProc(ref m); else base.WndProc(ref m);
}
but controls is not coming in this
if (m.Msg == NativeCalls.WM_COPYDATA && m.WParam == NativeCalls.HWND_BROADCAST) block that is main problem.
here i attach the link of my win application and that is https://onedrive.live.com/#cid=C4A6F16F34D7540A&id=C4A6F16F34D7540A!126 just download the skypecalltest and run it.
before run my apps just login to skype and then run my apps where you put a phone no and click on call button then you can see the controls is not coming repeatedly to the second if block.
so what i need to change in my code as a result control will come to second if block repeatedly .
in the same link there is another same kind of apps which is based on wpf and that is working where wndproc is calling repeatedly. if possible check that code too and guide me what i am missing or making mistake. thanks
tbhattacharjee
|
|
|
|
|
Tridip Bhattacharjee wrote: i have developed a small win apps Like this[^] one?
Did the application connect to skype? Does the demo from that website work?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
i develop my win apps following that application whose link you refer but that application is wpf based apps and working fine but my one is not working properly. if possible please download my apps from this link and run at your end to capture the problem. here is link from https://onedrive.live.com/#cid=C4A6F16F34D7540A&id=C4A6F16F34D7540A!126 just download the skypecalltest and run it and definitely notice that WndProc() function is calling repeatedly for getting message from Skype.
tbhattacharjee
|
|
|
|