|
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
|
|
|
|
|
hi, I wanna get cell value from my gridview.Ex- I have a column name called "CustName" in my gridview.It has a delete command aslo.After click on "delete" button I have to delete that particular customer from gridview.Before delete that customer i wanna assign that customers name to a "lable".Finally i wanna know how to assign that customer name to that lable.
protected void GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
// Code i need
}
Thankxxxx
CheeN
|
|
|
|
|
This might work for you...
label.Text = GridView2.CurrentRow.Cells["CustName"].Value.ToString();
|
|
|
|
|
how can i get the index of the items in datagrid's current page?
the source of the datagrid is from the datatable, now, i want to get the index of the items(shown of the datagrids current page)in the datatable.
|
|
|
|
|
I am getting the mp3 file properties using shell(ShellClass)...
Folder dir;
dir.GetDetailsOf(item, 19); //returns track number....
like that i am getting artist,album and other details.....
i need to get "Rating" property..... i tried with all index... like dir.GetDetailsOf(item, 20);,dir.GetDetailsOf(item, 21);
but i didnt get Rating informations....how to get it...?
|
|
|
|
|
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...
ginji
modified on Friday, June 20, 2008 3:12 AM
|
|
|
|
|
In the grid's CellClick event you could have code something like...
String sColName = GridView.Columns[e.ColumnIndex].Name;
if (sColName == "username")
TextUser.Text = GridView.CurrentRow.Cells["username"].Value.ToString();
|
|
|
|