|
|
hello am trying to make a bullet list and when i press at any item a message printed contains whic item i chose but i have an error:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0123: No overload for 'btnBullet_Click' matches delegate 'System.EventHandler'
|
|
|
|
|
I guessing that your btnBullet_Click method doesn't have the appropriate parameters
The method signature should probably look something like this:
void btnBullet_Click(object sender, EventArgs e)
|
|
|
|
|
Hi there.
I developed a video player like application, thanks to the help provided by the
responses to my last post,[^] i also made it a activeX component, being able to run
within a web browser.
Now i want to associate a MIME type to this application, so the associated file types can be
run directly inside the web page [ using a <object> / <embed /> environment ], but have no idea
how to achieve this.
Also i'd like to have the application being downloaded via the web site itself.
[ using the codebase / pluginspage tags ]
I also need some more information on this topic as well.
Any help is highly appreciated.
|
|
|
|
|
I am writing a program for Windows Mobile device and I am using datagrid to display data. The grid, will change size when a row is selected to show information at the bottom and once the data is saved/cancelled it will take the whole screen.
I was wondering as to how I can scroll the screen in the program automatically if the last row is selected. Coz when the last row is selected and the datagrid shortens in size, the selected row is hidden.
Thanks,
Ashoo
|
|
|
|
|
I don't know if this will work (since DGV is not really a list view), but you could try the following:
...
using System.Runtime.InteropServices;
using System.Windows.Forms;
...
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr handle, uint op, uint index, uint isPartialOK);
...
private const uint LVM_ENSUREVISIBLE = 0x1013;
...
private DataGridView dgv = ...;
...
if (dvg.SelectedRows.Count > 0)
// the final parameter is 0 if the entire row needs to be shown, or 0 if partial showing is OK
SendMessage(dgv.Handle, LVM_ENSUREVISIBLE, dgv.SelectedRows[0].Index, 0);
...
Let us know if this works!
Jeff
|
|
|
|
|
I am using DataGrid class. I cannot use DataGridView class in Mobile programming as the CF 2.0 doesn't support it.
Here is the code when the datagrid is clicked
private void dataGrid1_Click(object sender, EventArgs e)
{
DataRow flightDataRow = flightTable.DefaultView.ToTable().Rows[dataGrid1.CurrentRowIndex];
statusCombo.SelectedIndex = (int)statusHash[flightDataRow[6].ToString().Trim()];
gateCombo.SelectedIndex = (int)gateHash[flightDataRow[5].ToString().Trim()];
selectedDailyID = (int)flightDataRow[0];
selectedFlight = flightDataRow[3].ToString();
panel1.Visible = true;
panel1.Enabled = true;
dataGrid1.BringToFront();
}
After dataGrid1.BringToFront() is what I have to put the code where the datagrid should scroll to make sure that the selected row is visible. it is ok even if the selected row is the 1st row in the datagrid's view area.
Thanks,
Ashoo
|
|
|
|
|
I don't know if this will work (since DG is not really a list view), but you could try the following:
...
using System.Runtime.InteropServices;
using System.Windows.Forms;
...
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr handle, uint op, uint index, uint isPartialOK);
...
private const uint LVM_ENSUREVISIBLE = 0x1013;
...
private DataGrid dg = ...;
...
int selectedIndex = ...; // Get the index of the selected row
if (selectedIndex >= 0)
// the final parameter is 0 if the entire row needs to be shown, or 1 if partial showing is OK
SendMessage(dg.Handle, LVM_ENSUREVISIBLE, selectedIndex, 0);
...
Let us know if this works. (and yes, it is identical to the code in my last post except it uses DataGrid instead of DataGridView!)
Jeff
|
|
|
|
|
I tried it and it gives a MissingMethodException when I click on a row in the grid, for the SendMessage along with "Can't find PInvoke DLL 'user32.dll'.". I looked for user32.dll and that file is there, so i don't know how to fix it.
Thanks,
Ashoo
|
|
|
|
|
Try including the dll in your build output directory. Also change the DllImport to the following:
[DllImport("user32.dll", EntryPoint="SendMessageA", SetLastError=true)]
// Same line here
If that doesn't work, you could try to find the answer at one of the sites
here[^].
Let us know the results!
Jeff
|
|
|
|
|
Unfortunately I am unable to add the reference user32.dll, it says that a reference to user32.dll cannot be added. Also inspite of the above change I am still getting the same error as before. I even downloaded PInvoke.net and installed it.
Thanks,
Ashoo
|
|
|
|
|
You don't need to download anything, or reference anything. Just copy user32.dll into your executable directory.
Jeff
|
|
|
|
|
That was the first thing I tried and since that didn't work I downloaded the PInvoke.net.
Thanks,
Ashoo
|
|
|
|
|
Well, I'm stumped. Clearly this is related to the mobile device. I have never personally written anything for a mobile device, so I don't know what else to tell you. Hopefully someone else from the forum can help, or you can find some information through google on how to code against common windows dll's in a mobile environment. Sorry I can't do more for you, but be sure to post the answer if you find it so others can benefit (and so we can help the next guy with the same question).
Jeff
|
|
|
|
|
Thanks Jeff for all your help. I will surely post the answer when I find it. I think so too that it is related to mobile device. I think the user32.dll doesn't get deployed on the mobile when the rest of the code does and hence it not able to find the method.
Thanks,
Ashoo
|
|
|
|
|
i have a table EmployeeInfo in sql 2000 that have two attributes say EmpID & EmpName i am displaying the EmpName only in a datagridview but when i delete it it give error that cannot delete the key blah blah
so how to delete the whole row from sql2000
please note that i am only displaying the EmpName in the data grid
sas
|
|
|
|
|
There should be a property of the DataGrid called DataKeyField. Try setting this to the employee id and see if that works.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I am trying to develop an application using Windows Forms to have streaming IO such as would be used with Console.OpenStandardInput.
I want to be able to retrieve data from a Windows form in the same manner as using "Console.OpenStandardInput". Is there a way to do this!?
-- modified at 11:54 Monday 12th November, 2007
|
|
|
|
|
BGearig wrote: I want to be able to retrieve data from a Windows form in the same manner as using "Console.OpenStandardInput". Is there a way to do this!?
Your post doesn't make sense. The example for Consol.OpenStandardInput has the application reading the keyboard input from the console window. You state you want to retrieve data from the application not read it into the application.
I think you need to clarify your requirements if we have any chance of helping you. Also before doing that perhaps you might read this[^] as it might help your messaging attempts.
|
|
|
|
|
I will be giving a colleague training in C#, and would like to offer it in the form of a series of one day courses. I would like to cover beginners and intermediate level practical, real world, programming in, say, four courses, and I would like some input on my syllabus. So far I see language basics, and common tasks, e.g. basic data access, in course #1; collections and .NET classes, and Windows Forms essentials in course #2; component design and implementation, interfaces, inheritance, generics, reflection etc. in course #3; and course #4 as a guided practical project, of nature still to be determined.
Calling all South African developers! Your participation in this local dev community will be mutually beneficial, to you and us.
|
|
|
|
|
Walk him through C# Step-by-Step by Microsoft press. You'll want to change some details on the way but it covers everything for the basics.
|
|
|
|
|
Have you tried just doing a ping on all the client instances, you know, just to see if they are running?
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
yeah... i tried
actually i tested like braodcasting 1-100 numbers
@ client side i receives like Client A receives -> 1 3 4 5 10 11 12 (missing ...)
Client B receives -> 1 2 3 4 7 8 15 16 (missing ...)
Client C receives -> 4 5 6 10 11 12 15 (missing ...)
so thats what im wondering if sockets are useless though connection is "TCP"
Determination and faith are the only keys !
|
|
|
|
|
Hi everyone
My apologies if this has been asked before, I suspect it may have but does anyone know of any tutorials for C# ListBox drag and drop in which you are simply dragging FROM a ListBox to an external program such as simply Windows Explorer?
All the tutorials I seem to find are regarding making controls accept drag events.
Regards and thanks in advance.
|
|
|
|
|
You should be able to do the following:
...
using System.Windows.Forms;
...
private ListBox lb;
...
private void SomeEvent(object sender, EventArgs e) {
object data = ...; // set this to be the data you want to be dragged
// note that the data MUST be a type recognized by the system
// for it to be able to be dropped onto the desktop (like a file)
DragDropEffects result = lb.DoDragDrop(data, DragDropEffects.All);
// Do some stuff based on whether the result is move, copy, etc.
}
Hope this helps!
Jeff
|
|
|
|