I'd recommend you to create your own control inherited form DataGrid. It should consist of a DataGrid and your footer (you can create it of textboxes, labels, datagrids etc.) I feel it is nice solution, because you can always replace your component with another one implementing your IDataGridWithFootter. Regards
Heinzzy
Posts
-
VB.Net Data Grid with Footer -
RSA Keyslook here it's quite simple!
-
decimal questionif I correctly understand your post
double i = 11157.0;
Console.WriteLine(i.ToString("#.#"));else clarify it plz
-
Windows serviceThank you all! I realize that it was bad idea and switch to autorun application without UI.
-
Windows serviceSure, but I'd like to start applications on the users desktop :((
-
Windows serviceunfortunately if I use Process.Start applications run without any interface :(
-
Windows serviceHow can I make my service to start certain application, so user'll be able to use it?
-
DataGridView and Deleting Rows/// My stumbling point seems to be when I remove 1 using RemoveAt, the index numbers change and I get exceptions. delete items upward from bottom to top of datagrid
-
ListBox.DisplayName problemUnfortunately Pair contains only public fields named First and Seconds, but DisplayMember specify a name of the PROPERTY to display. So you could make it work like this
{
//form classprivate void Form1_Load(object sender, EventArgs e)
{
ArrayList list = new ArrayList();
MyPair f = new MyPair("A", "B");
list.Add(f);
listBox1.DataSource = list;
listBox1.DisplayMember = "second";
}
}class MyPair { public object First { get; set; } public object Second { get; set; } public MyPair(object a, object b) { this.First = a; this.Second = b; } }
-
Reg: Disabling single item of CheckedListBox in C# -checkedListBox1.SetItemCheckState(1, CheckState.Indeterminate);
-
Close All Child Window on Menu Click!private void button2_Click(object sender, EventArgs e)
{
foreach (Form2 f in this.MdiChildren)
{
f.Dispose();
}
} -
windows not in focusI feel that using a socet connection between service and application is not a good idea because this connection can be terminated by firewall etc ps use logging instead
-
windows not in focusSo, we have a result here. To accomplish the mission you should definitly create a service. With hooks! ;)
-
windows not in focusTo capture Keyboard stream use hooks Read this http://msdn.microsoft.com/en-us/library/ms632589(VS.85).aspx[^] Simple example
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Runtime.InteropServices; namespace hook { class Program { private const int WH_KEYBOARD_LL = 13; private const int WM_KEYDOWN = 0x0100; private static LowLevelKeyboardProc _proc = HookCallback; private static IntPtr _hookID = IntPtr.Zero; static void Main() { _hookID = SetHook(_proc); Application.Run(); UnhookWindowsHookEx(_hookID); } private static IntPtr SetHook(LowLevelKeyboardProc proc) { using (Process curProcess = Process.GetCurrentProcess()) using (ProcessModule curModule = curProcess.MainModule) { return SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0); } } private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam); private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if ((nCode >= 0) && (wParam == (IntPtr)WM_KEYDOWN)) { int vkCode = Marshal.ReadInt32(lParam); if (((Keys)vkCode == Keys.LWin) || ((Keys)vkCode == Keys.RWin)) { Console.WriteLine("{0} blocked!", (Keys)vkCode); return (IntPtr)1; } } return CallNextHookEx(_hookID, nCode, wParam, lParam); } [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern bool UnhookWindowsHookEx(IntPtr hhk); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam); [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
-
windows not in focusAlthough it's rather unwieldy task I guess I know a way to perform it. To interact with an application that is not in focus I recommend you to use windows application log. Create the window service to handle BC input and write it down to the Log. In the application - check the Log for new entries on timer event and if it exists put it into your textbox. So despite your application might be not in focuse it still can achieve data from BC.
-
windows not in focusBut we still can distinguish BC from user by using prefixes. What do you think?
-
windows not in focusOriginalGriff wrote:
Then you have a problem. all the Keyboard emulating BCRs I have seen read teh BC and just provide a datastream as if the barcode data had been typed by the user.
I feel it's all ok. User such as a cashier isn't supposed to use a keyboard very often. So we can redirect BC stream to the textbox. In the textbox handler we can validate BC/user input. For example - user always start typing session with "A" char, else it's BC's chars.