|
That's used to show the desktop; it'd be very frustrating for a user if he/she can't reach their desktop. There's also a minor difference[^] between "Minimize All" (Win-L) and "Show Desktop" (Win-D).
Bastard Programmer from Hell
|
|
|
|
|
I totally agree with You my friend...I also think that is very frustrating for the user to prevent from "Show Desktop" feature...
Qendro
|
|
|
|
|
Eddy Vluggen wrote:"Minimize All" (Win-L) Interesting: on my Win 7 Pro machine, Win-L switches me to the log-in screen where I could, potentially, switch users, and where I have to click on my current user icon to return to "normal use" mode.
best, Bill
"Last year I went fishing with Salvador Dali. He was using a dotted
line. He caught every other fish." Steven Wright
|
|
|
|
|
BillWoodruff wrote: Interesting: on my Win 7 Pro machine, Win-L switches me to the log-in screen where I could, potentially, switch users, and where I have to click on my current user icon to return to "normal use" mode.
Not interesting, merely a typo. Win-M does a minimize all, Win-D shows the desktop.
Bastard Programmer from Hell
|
|
|
|
|
Eddy Vluggen wrote: merely a typo My faith in you remains unshaken !
Win-Shift-M will restore all the Windows minimized by Win-M.
And a second Win-D will also restore.
All of which I gleaned from the excellent link you provided, thanks.
best, Bill
"Last year I went fishing with Salvador Dali. He was using a dotted
line. He caught every other fish." Steven Wright
|
|
|
|
|
Hehe, thanks
|
|
|
|
|
Google Result[^]
Here is a google search result, I saw there are few solutions.
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
That would be user-hostile; don't do it.
|
|
|
|
|
I have not folded to my program
|
|
|
|
|
Hello,
I need to create a custom shaped button which looks like a forward arrow. Three or four of such buttons are to be placed next to each other in such a way that the tip of the first button is just near the tail of the next button
I have made a style for the button using polygon in .xaml & assigned this style to the button. Now, if i add this button to a form, i can see this button in the desired style.
But, still the button has the rectangular shape, which is not visible as the borders & remaining area are transparent. So, the button occupies a rectangular area on the form irrespective of the style which i created.
Because of this, i cannot keep the forward shaped butons next to each other, as close as desired. Here, for the tip of one forward button to come near the tail of the next button, the rectangular area of the buttons must overlap, which is not correct.
Is there any way to remove the rectangular area of the button & make it exactly to occupy the desired shape as specified by the style.
The .xaml file for my code is given below
<Window x:Class="Styles.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="150" Width="525">
<Window.Resources>
<Style x:Key="Poly1" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Polygon Fill="{TemplateBinding Background}" Points="10,10 80,10 120,45 80,75 10,75 45,45" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="2"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True"/>
<Trigger Property="IsDefaulted" Value="True"/>
<Trigger Property="IsMouseOver" Value="True"/>
<Trigger Property="IsPressed" Value="True"/>
<Trigger Property="IsEnabled" Value="False"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<WrapPanel>
<Button Style="{DynamicResource Poly1}"></Button>
<Button Style="{DynamicResource Poly1}"></Button>
</WrapPanel>
</Window>
Best Regards,
Abhilash
|
|
|
|
|
Don't post this is in both the forums and Q&A - pick one and stick with it.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Using a Path object, you can make your button look like exactly what you want to to be.
See here[^] for more information.
|
|
|
|
|
Hello Abhinav,
Thanks for the reply. If you noticed my query, i am already making some custom shaped button. The actual requirement is about alignment of the controls, close to each other.
Any control in .NET has a rectangular shape. We can see a rectangular shape around any control while adding to the UI. My question is regarding avoiding this rectangular shape.
This alignment can be done by adding 2 of such buttons in a canvas or a single cell in a datagrid, by making the controls ovelapping each other (not the graphical area, only the transparent rectangular part of the control). But, if i need to add them in such a way in stack panel or any other container which adds controls next to each other, the second control is added only after the transparent rectangular part of the control.
So, i am lloking for an option to change the underlying rectangular layout, whcih is not visible at run time. Is there any way to achieve this?
Best Regards,
Abhilash
|
|
|
|
|
Generally our grid is like
ID Name
1 Adit
2 Prerak
3 Shyam
but i want to display this like below
ID 1 2 3
Name Adit Prerak Shyam
So which control i use,gridview,DataList,listview,... (In web form)
and any link for this type of example
|
|
|
|
|
It's impossible to advise you which is the one you should use. Take a look at the documentation for each control and decide which one best fits your requirements.
|
|
|
|
|
Please forgive my desperate plea but I am trying to find out why the following code only half works.
My code
namespace WindowsService1
{
public partial class ServiceName : ServiceBase
{
public ServiceName()
{
InitializeComponent();
string sSource;
string sLog;
string sEvent;
sSource = "MyServiceName";
sLog = "Application";
sEvent = "MyServiceName starting";
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
EventLog.WriteEntry(sSource, sEvent);
EventLog sysLog = new EventLog("System", ".");
sysLog.EntryWritten += new EntryWrittenEventHandler(OnEntryWritten);
EventLog.WriteEntry(sSource, "logger started");
Console.WriteLine("Logger started");
}
public void OnEntryWritten(object source, EntryWrittenEventArgs e)
{
string sSource;
string sLog;
sSource = "MyServiceName";
sLog = "Application";
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
EventLog.WriteEntry(sSource, "sqllogger started");
SqlConnection Conn = new SqlConnection("User id = x; password = y; server=z;database=dbname;connection timeout=30");
SqlCommand ins = new SqlCommand("INSERT INTO dbo.TableName(TimeWritten, Source)VALUES (@TimeWritten, @Source)", Conn);
ins.Parameters.Add("@TimeWritten", SqlDbType.DateTime);
ins.Parameters.Add("@Source", SqlDbType.NVarChar, 20);
ins.Parameters["@TimeWritten"].Value = e.Entry.TimeWritten;
ins.Parameters["@Source"].Value = e.Entry.Source;
TableName.Open();
ins.ExecuteNonQuery();
TableName.Close();
}
The account the service runs under is a local admin on the Windows XP host.
Please could one of you Gurus tell me what I am doing wrong?
|
|
|
|
|
why don't you have proper exception handling in your code, showing the occasional exception in all its glory, i.e. by calling its ToString() method?
why are you just ignoring return values of those methods that are eager to tell you how bad or well they did, such as SqlCommand.InsertExecuteNonQuery()?
why should we have a guess when you probably have all the answers within reach?
PS: there are ways to more easily debug a service, not making the code into a service until it all works obviously is one of them.
[EDIT] Method name fixed [/EDIT]
modified 21-Oct-11 7:56am.
|
|
|
|
|
Hi Luc,
I do have exception handling. Every segment has a "try" preceeding it and a "catch > ToString" and the end of it. I didn't include it in the code I posted because it wasn't relevant. No errors are reported during the coding phase, the building or the service installation. The code "should" work despite the "try/catch" phrasing.
Is there a difference between the "SqlCommand ins" in my code and the SqlCommand.Insert()you mention? If so could you tell me where to find it as I have to come across an example of a working difference?
If I had the answers this conversation wouldn't be taking place
PS. The code works perfectly in a console application. I am looking for help in understanding why it doesn't work as a service.
Thank you for your time though.
|
|
|
|
|
CCodeNewbie wrote: I didn't include it in the code I posted because it wasn't relevant.
Please don't show modified code snippets when the code does not behave as you expect; show the most relevant methods unmodofied, and wgen that is not possible and you must change them (way too long, or NDA-like problems), tell us. When you don't understand why it does what it does, you're probably not in a position to make correct judgement calls either.
Having said that, Bob's remark on static vs instance seems very much to the point.
|
|
|
|
|
You're writing via static methods on EventLog, but you're attaching the event handler to the new instance syslog that you create and then do nothing with. Unless the EventLog class is doing some really weird stuff, that handler will never get fired.
|
|
|
|
|
I would try
sysLog.WriteEntry(sSource, "logger started");
instead of
EventLog.WriteEntry(sSource, "logger started");
This way your event handler should be called.
|
|
|
|
|
The correct syntax is to monitor event log entries in a Windows service is
protected override void OnStart(string[] args)
{
EventLog AppLog = new EventLog("Application", ".");
AppLog.EntryWritten += new EntryWrittenEventHandler(AppLogEntryWritten);
AppLog.EnableRaisingEvents = true;
}
Thanks to all for their input
|
|
|
|
|
I am having some basic compile issues defining a BorderBrush.
http://msdn.microsoft.com/en-us/library/system.windows.controls.border.borderbrush.aspx
states that you define a borderbrush like this:
myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
but in my code, when I try
border1.BorderBrush = Brushes.SlateBlue;
I get
Error 1 The name 'Brushes' does not exist in the current context
and I have included the namespace
System.Windows.Controls
as a "using" statement at the top of the file
as well as a Reference to the project.
What am I missing?
|
|
|
|
|
As you can see here[^] the Brushes class lives in the System.Windows.Media namespace. So you need to include that via using also.
Cheers!
—MRB
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
using System.Windows.Media;
is there. It still does not work.
Here is all I am using:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
|
|
|
|