|
You cannot see the GUI of service. You can create a process in service, but you must find another way to create it. Probably you can using event or something like that. For example :
If my service is started, then create a new process.
|
|
|
|
|
I don't need to see the GUI of service. What I want to see is the GUI of the process created by my windows service.For example:
I send a message to my service and my service should open a .txt file by notepad. What I want to see is the GUI of notepad,so I can edit the file. But I can the notepad process in the task manager instead of the GUI of it on the screen.
So, could you tell me if I want to see the GUI of notepad in this case, what should I do?
Thank you!
|
|
|
|
|
In my project, I have created custom text box deriving it from text box control. I would like to select the text present when focus is received in the custom text box. Focus can be received in custom control either pressing tab or clicking into the textbox control. In my custom control I have overridden the getfocus behaviour and placed following code :
protected override void OnGotFocus(EventArgs e)
{
if (!ReadOnly)
{
BackColor = _backHighLightColor; // just to change back color
// to selected complete text in the textbox when focus received
SelectAll();
}
}
With above line of code, text in the custom textbox control gets selected when I'm getting the foucs into the control using the tab but doesn't select the text when i click into the custom text box.
I could write the above code in the click event of custom control by overriding the base implementation for click but i don't want to do that as click event of my custom control is intended to do some other functionality as well.
Can anyone help me with this?
regards,
KC
|
|
|
|
|
Hi, KC.
KrunalC wrote: I have overridden the getfocus behaviour
It's better to override OnEnter() method because you have a side effect with your code in OnGotFocus() (1. enter some text into your textbox; 2. go to an another form 3; go back to your form. After this your text will be fully selected. It's not a correct behaviour (although IE uses it in the address bar)).
KrunalC wrote: I could write the above code in the click event of custom control by overriding the base implementation for click but i don't want to do that
I think you have to do that. But override OnMouseDown() instead of OnClick(). It will be more common behaviour. And you'll have to add some logic there to prevent selection when control already has focus.
|
|
|
|
|
Andrew,
Thanks for your reply.
I have gone through your reply but I'm afraid it will not serve the purpose for me. I got your argument on why I should override OnEnter() rather than OnGotFocus(). But still I will have to override the Click or Mousedown. Basically I want to avoid this. Also I would like to know why such behaviour is there. Why focus i received by clicking the control not giving the expected behaviour as got foucs.
I would appreciate if someone can explain me the behaviour i.e. what is the difference when focus is received by pressing the tab key or when focus is received by clicking into the control.
Thanks,
KC
|
|
|
|
|
I think the difference between tab-focus and mouseclick-focus is:
1. When control receives focus by pressing tab the only one action occurs -- receiving focus. At this moment you select all the text and cursor automatically goes to the end of the text.
2. When control receives focus by clicking into the control there are two actions: At first you have behaviour as described at 1. But then control must move cursor to the position where you clicked within the control. And this movement clears the selection. (It looks like you select control with tab and then press arrow key to move cursor within the control.)
I don't think you can prevent this behaviour for the common winform textbox without overriding mouse events.
|
|
|
|
|
Andrew,
I'm getting what you are saying. I searched the web for this problem and my finding is also in line with what you have said in your reply. I think I will not be able to get the desired behaviour without overriding the mouseevent or click event.
Thanks a lot for replying my question.
regards,
KC
|
|
|
|
|
how to connect MAPINFO with C#
|
|
|
|
|
|
You should think about using MapXtreme instead. It's basically a .Net wrapper for the Ellis library which is the core for (nearly) all MapInfo products.
|
|
|
|
|
I am developing an application in VS2003, using a tabcontrol with collection of 5 tabpages, onload I have tabpage1 as main menu, on mainmenu I want picture boxes to link to other tab pages,I have linked the picture box click event to tabPage show method, but not working.
note: If I moved the tabpage 1(main menu) to last index then its working..
Does the tabPage index and click events are related?
Please help me.
Aruna
|
|
|
|
|
You should set tabControl.SelectedIndex instead of using tabPage.Show() method.
|
|
|
|
|
Hey,
How would I implement a tab control in VS2005? I don't think there is a tabbed control in .NET 2.0??
Cheers.
|
|
|
|
|
ma se wrote: I don't think there is a tabbed control in .NET 2.0??
You can find it on the "All Windows Forms" tab in the Toolbox.
|
|
|
|
|
Sorry, I meant for web applications. Everyone says that I must use the multi view control, or something like that.
|
|
|
|
|
Thanks again, your code is working fine
|
|
|
|
|
Thanks Andrew Lygin.
Its solved my problem too.
Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hi,
Would like to apply colors (BG Color, FG color & Font Color) of selected windows ColorScheme for windows controls.
Currently reading the ColorSchme vaues from registry by using
Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Control Panel").OpenSubKey("Appearance").OpenSubKey("Schemes")
This will return the Scheme values…..e.g. Brick, Arizona etc….
I would like to get the color values for windows controls for the selected colorscheme.
Can anybody help in this?
Thanks,
RK
|
|
|
|
|
Hi, RK.
I think System.Drawing.SystemColors class can help you.
|
|
|
|
|
hi all,
are there any ways we can pass in commands in command prompt using c# programming? i have an .exe file which i need to exec from my program, however i have problems with doing so when i tried using microsoft.bulid.task 's exec class. Can anyone help?
thanks
|
|
|
|
|
If you want to start a program (.exe), you can use :
System.Diagnostic.Process.Start("test.exe", "another command");
|
|
|
|
|
so i do not need to indicate where is the .exe file?
and wat do u mean by another command?
if i want to pass in command(as in on in the command prompt)? e.g copy i.txt j.txt
thanks
|
|
|
|
|
This sample has more details:
System.Diagnostic.Process.Start(@"c:\test\consoleapplication1\debug\test.exe", "i.txt j.txt");
|
|
|
|
|
what if i have more then 1 command?
thanks
|
|
|
|
|
How could i manage windows display setting(screen resolution)from win application ?
OR how could i set my win application according to screen resolution?
salmani
|
|
|
|