|
Have a look at this article's[^] meesages, especially the section named Simple Solution.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I want to display a calender on desktop [right side] if any one can help me helping link
Please keep following points in mind
- application will be running in background. [at startup]
- icon will be in Tray no tab in Task bar. when double clicked then in Task Bar.
Thanks
modified on Sunday, March 1, 2009 5:16 AM
|
|
|
|
|
Install Vista. There's a calendar available by default in the sidebar.
|
|
|
|
|
Yes, there are gadgets available that you will get it for free in Vista or windows 7.
Thanks
|
|
|
|
|
Dear Both
I am going to built a reminder application in which i have to display a calendar on desktop that's why i ask for help
thanks
|
|
|
|
|
Hi All,
I want to know how we can get the printer status/state whether it is out of paper, paper jammed etc.
|
|
|
|
|
|
Hi there,
I'm trying to read a few pixels (200) from my screen, repeatedly. Though what I have found is that
1) the Graphics method CopyFromScreen() has quite a high overhead. Whether I read 1 pixel or 1000 doesn't matter. It's always 33ms, and it doesn't even matter if I keep creating new Bitmap / Graphics objects or reuse the old ones.
2) unmanaged GDI32.BitBlt has exactly the same problem, even if I reuse all hDCs.
So, my question is, is there a fast way to obtain a few pixels from the screen? I already thought about using Direct3d, but I fail using it - and I don't even know if that would perform any better. It keeps throwing a BadImageFormatException at me, and says it's not a Win32 application (Exception from hResult: 0x800700C1). Btw, I don't even want to save to HD. I just want the raw pixels in memory to play around with them. The stuff below was just taken from an example I found.
That's the code I tried to use:
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = false;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.PresentFlag = PresentFlag.LockableBackBuffer;
presentParams.BackBufferWidth = 1280;
presentParams.BackBufferHeight = 1024;
presentParams.MultiSample = MultiSampleType.None;
presentParams.DeviceWindowHandle = User32.GetDesktopWindow();
Device device = new Device(0, DeviceType.Hardware, User32.GetDesktopWindow(), CreateFlags.HardwareVertexProcessing, presentParams);
Surface backbuffer = device.GetBackBuffer(0, 0, BackBufferType.Mono);
SurfaceLoader.Save("Screenshot.bmp", ImageFileFormat.Bmp, backbuffer);
backbuffer.Dispose();
Any hints on a quicker way to read a few pixels, all in one horizontal line, would be appreciated
|
|
|
|
|
I don't know. You may need a Windows API function.
|
|
|
|
|
I did try Windows API. GDI32.BitBlt, which performs just as badly.
|
|
|
|
|
Can anyone tell me how can we extract triplets(subject-object-predicate) from a sentence in C#.Do we have to use wordnet for it??
|
|
|
|
|
Does this[^] helps?
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
|
|
|
|
|
Hi All;;
I WANT TO add asp TexBox To A Web Page by C# Code
Please How I Can Do That??
Thanks All;;;;;
|
|
|
|
|
zead wrote: Please How I Can Do That??
1. Wrong forum.
2. What is ASP textbox? Did you mean "asp:textbox" thing? If yes then rush to nearest book store.
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
modified on Saturday, February 28, 2009 4:09 AM
|
|
|
|
|
hi,,
i mean not html controls, server side textbox??
|
|
|
|
|
You need a book.
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
|
|
|
|
|
In Page_Load create an instance of TextBox and add it to Page.Controls :
TextBox txt = new TextBox();
...
this.Controls.Add(txt);
|
|
|
|
|
hi all
I have a BHO application (C#)
anyone knows if I can use cookies with BHO ? if so, how?
thanks
|
|
|
|
|
Hi Evryone
I looking for cool Tips & Tricks in C#
Is anyone know some good Web sit's ?
thank's
|
|
|
|
|
E_Gold wrote: Is anyone know some good Web sit's ?
Yes
Check here[^]
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Search on google I know to do....
I was asking for someone who work whit good website for tips & tricks
and whant to shere whit me
|
|
|
|
|
StackOverflow[^] has dedicated a page to some of the less-known features of the language.
Enjoy
I are troll
|
|
|
|
|
Hi,
I am having trouble using interfaces with a Generic List. I have taken an extract of my problem below which consists of two interfaces, one for a single object (itemInterface) and one for a collection of those objects (collectionInterface) and then the objects that implement these interfaces. Client and ClientCollection.
public interface CollectionInterface
{
bool IsServer
{
get;
set;
}
void LoadServerInserts(DateTime lastSync);
void LoadClientInserts();
void LoadServerUpdates(DateTime lastSync);
void LoadClientUpdates();
void LoadClientDeletes();
void LoadServerDeletes();
void RunCommand(string sql, bool isServer);
}
public interface ItemInterface
{
bool IsServer
{
get;
set;
}
bool IsNew
{
get;
set;
}
void Save(bool includeSyncBit);
void ClearSync();
}
Client : ItemInterface
{
//client related stuff inlcuding interface methods and members
}
ClientCollection : System.Collections.Generic.List<Client>, CollectionInterface
{
//client collection related stuff inlcuding interface methods and members
}
When I try and use these objects on a form I get the error:
foreach statement cannot operate on variables of type 'CollectionInterface' because 'CollectionInterface' does not contain a public definition for 'GetEnumerator'
This is on my windows form....
private void doSomething CollectionInterface a, CollectionInterface b, CollectionInterface conflicts)
{
//update the server with the client updates
foreach (ItemInterface item in a)
{
if ( b.Contains(row))
{
conflicts.Add(row);
}
}
}
I wondered if I needed to change the collection interface as follows:
public interface CollectionInterface:IList<ItemInterface>
But this gave me even more errors.
I would be really really grateful for any help on this, I have been tearing my hair out over the last few hours
|
|
|
|
|
Not sure why you need to do this. Making the ClientCollection class derive from List<Client> or List<ItemInterface> should be sufficient. Creating a n interface that derives from IList<ItemInterface> is just going to create a wrapper around an internal list of the same.
Anyway, this is how you do it. I've use IItem and ICollection for the interface names.
Client clientA = new Client(1);
Client clientB = new Client(2);
Client clientC = new Client(3);
ClientCollection clients = new ClientCollection();
clients.Add(clientA);
clients.Add(clientB);
clients.Add(clientC);
foreach(IItem item in clients)
{
Console.WriteLine(item.ID);
}
public interface IItem
{
Int32 ID { get; set; }
}
public interface ICollection : IList<IItem>
{ }
public class Client : IItem
{
public Client(Int32 id)
{
ID = id;
}
#region IItem Members
public int ID
{
get;
set;
}
#endregion
}
public class ClientCollection : ICollection
{
private List<IItem> list;
public ClientCollection()
{
list = new List<IItem>();
}
#region IList<IItem> Members
public int IndexOf(IItem item)
{
return list.IndexOf(item);
}
public void Insert(int index, IItem item)
{
list.Insert(index, item);
}
public void RemoveAt(int index)
{
list.RemoveAt(index);
}
public IItem this[int index]
{
get { return list[index]; }
set { list[index] = value; }
}
#endregion
#region ICollection<IItem> Members
public void Add(IItem item)
{
list.Add(item);
}
public void Clear()
{
list.Clear();
}
public bool Contains(IItem item)
{
return list.Contains(item);
}
public void CopyTo(IItem[] array, int arrayIndex)
{
list.CopyTo(array, arrayIndex);
}
public int Count
{
get { return list.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public bool Remove(IItem item)
{
return list.Remove(item);
}
#endregion
#region IEnumerable<IItem> Members
public IEnumerator<IItem> GetEnumerator()
{
return list.GetEnumerator();
}
#endregion
#region IEnumerable Members
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
#endregion
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hello,
Can someone help me understand how to read a packet?
I believe i have gathered all the necessary bytes but am having a hard time reading the data from the packet.
I thought I could attach the pdf here, but instead i will provide a snippet and maybe i can move on from there.
Here are the first 10 bytes as described in the document I have.
Unique Header Bytes
Byte1: Header Byte 0xFE
Byte2: Header Byte 0xFF
Byte3: Header Byte 0x03
The value of “Volt” must be divided by ten. This provides one
decimal place resolution.
Byte4: Volt Hi Byte
Byte5: Volt Low Byte
CH1 Absolute Watt-Second counter.
This 5-byte counter increments with energy flowing in either direction (consuming or producing).
Byte6: CH1 W-S Byte1 (LSB)
Byte7: CH1 W-S Byte2
Byte8: CH1 W-S Byte3
Byte9: CH1 W-S Byte4
Byte10: CH1 W-S Byte5 (MSB)
I tried the following code to get the VOLTS, but its not working.
private void ProcessData(SocketPacket packet)
{
byte[] buffer = new byte[packet.ms.Length];
//packet.ms.Position = 0;
packet.ms.Seek(3, SeekOrigin.Begin);
packet.ms.Read(buffer,0,2);
int data = BitConverter.ToInt32(buffer, 0);
}
Can anyone offer some ideas?
Drew
|
|
|
|