|
list is ordered collection and u can retrive value based on index
rahul
|
|
|
|
|
First of all Try Google
|
|
|
|
|
alternate codes for Close();
|
|
|
|
|
u may try Dispose();
rahul
|
|
|
|
|
mention some subject while posting.
use dispose.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
ok,, i mean when closing the form.. exitng from the form...
|
|
|
|
|
first of all read this[^]
second of all go buy a beginners book...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Never Put Subject like this
|
|
|
|
|
Hi! I want to know how is possible to pop-up calendar when the drop down control is expanded. Thx ahead
|
|
|
|
|
on the click event of combo box u can open ur calendar
rahul
|
|
|
|
|
can you give me some example...cause I tried like this:
private void comboBoxChooseOrderDate_DropDown(object sender, EventArgs e)
{
MonthCalendar calendar = new MonthCalendar();
calendar.Show();
}
and it doesn't want to popup, any help? Thanks
|
|
|
|
|
private void comboBoxChooseOrderDate_OnClick(object sender, EventArgs e)
{
MonthCalendar calendar = new MonthCalendar();
calendar.Show();
}
rahul
|
|
|
|
|
|
Use Javascript for that.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Try the DateTimePicker object.'
Kjetil
|
|
|
|
|
that was the thing what I am looking for. Thanks and have a nice day!
|
|
|
|
|
<pre>I wrote code to access structre from C# .net where structure is in C dll .when i debug the code i got garbage value in the variables.
here are the two files .
------------------------- StrcutreDisplay.dll---------------------------------
#include<iostream.h>
#include<conio.h>
#include<malloc.h>
#include<string.h>
extern "C"
{
typedef struct
{
char *fname;
char *lname;
}Detail;
__declspec(dllexport) Detail * Disp()
{
Detail *ptr=(Detail *)malloc(sizeof(Detail));
ptr->fname = (char*)malloc(50);
memset(ptr->fname, 0x00, 50);
ptr->lname = (char*)malloc(50);
memset(ptr->lname, 0x00, 50);
strcpy(ptr->fname, "larson");
strcpy(ptr->lname, "scolari");
return ptr;
}
}
----------------------------StructureExample---------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace StructureExample
{
class Program
{
[StructLayout(LayoutKind.Explicit)]
public struct Detail
{ // [MarshalAs(UnmanagedType.LPStr)]
[FieldOffset (10)]public unsafe char* fname;
[FieldOffset(10)]public unsafe char* lname;
}
// strucure DLL
[DllImport("StructureDisplay.dll")]
public static unsafe extern Detail * Disp();
static void Main(string[] args)
{
unsafe
{
Detail * var = Disp();
char* a = var->fname; //here i get garbage value and the value of this expression may be incorrect.it could not be evaluated because 'Cannot derefrence'(*var).fname' the pointer is not valid.
char* b = var->lname; // 'Cannot derefrence'(*var).lname' the pointer is not valid.
}
// IntPtr por = Disp();
//unsafe
//{
// Detail* ger;
// ger =(Detail )Marshal.PtrToStructure(por,typeof(Detail ));
//}
Console.WriteLine("hello world");
Console.Read();
}
}
}
------------------------------------------------------------------------------------------------
when i access that dll from c it works fine but through .net i get some garbage value.when i tried to convert char * to string by using a method of Marshal class (ptrToStringAuto() or ptrToStringAnsi())that time also i get some garbage value.My main question is why i am getting garbage value in char * a and char * b.
Any help appreciated.
Thanks in advance.</pre>
|
|
|
|
|
First, you have set the same field offset for your two members in the struct, which means that they occcupy the same memory area.
Second, you have set the field offset to ten. Why do you think that the structure starts with ten unused bytes?
If you use the fields offsets 0 and 4, it may have a chance to work.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
it doesn't work.please tell me how to solve this problem?
any help appreciated
thanks in advance.
|
|
|
|
|
cristi_alonso wrote: it doesn't work.please tell me how to solve this problem?
With a description as vague as "doesn't work", it's not very easy to offer any guidance... What happens exactly when you try what I suggested?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
hi...
could someone tell me the codes for this scenario..
if i click on the datagridview for example username
if i click that username that username will appear in a label or textbox...
thanks...
|
|
|
|
|
you heard something called CellClick even.
Then just get the value of selected cell and giv it to the Text property of your control(Label, TextBox ...)
And don't ask your question twice!!!
Strahil Shorgov
|
|
|
|
|
sory for asking twice...
i know what your saying but i dont know how to get the value of the selected cell...
can you tell me...
|
|
|
|
|
Try this
tbUserName.Text = gvUsers.SelectedCells[0].Value.ToString();
Strahil Shorgov
|
|
|
|
|
Try the CellEnter event:
void dataGridView_CellEnter(object sender, DataGridViewCellEventArgs e)
{
if (((DataGridView)sender)[e.ColumnIndex, e.RowIndex].Value != System.DBNull.Value)
Textbox.Text = ((DataGridView)sender)[e.ColumnIndex, e.RowIndex].Value.ToString();
}
Kjetil
|
|
|
|