|
Does anyone have a clever idea on how to bind RadioButtons?
|
|
|
|
|
How do I exactly do it?
I am just learning C#, I have a C++ background and in C++ it was something like this:
class someclass {
public:
int somemember;
someclass(int i)
}
someclass::someclass (int i) :
somemember(i)
{
}
Is there something similar in C# or is this enough?
class someclass
public int somemember;
public someclass(int i)
{
somemember = i;
}
}
Tnx
Dragan
|
|
|
|
|
You are doing the right thing.
Alomgir Miah
Live Life King Size
|
|
|
|
|
While looking at all this XML stuff I keep seeing this stream thing. What exactly is stream when doing xml syncronization?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
A stream is an abstraction of the idea of data flow. In other words, a stream is most typically a file on your hard drive, but can be something else.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
When I populate my datagrid in my dialog app can I limit it as to what columns I want to show?
Also I found an example on how to do ADO.NET programming in C# using name space system.data.ADO. However I do not have this on my machine. Did this change and if so what tutorial would be a good one to read to show the changes?
Last question If I'm opening an Access 2000 database using the dataset (hopefully this is right) would this be okay if i'm populating a list control or would a datagrid work better?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
You can use your DataSet's ColumnMapping property to hide a column.
// Creating connection and command sting
string conStr = @"Provider=Microsoft.JET.OLEDB.4.0;data source=C:\northwind.mdb";
string sqlStr = "SELECT * FROM Employees";
// Create connection object
OleDbConnection conn = new OleDbConnection(conStr);
// Create data adapter object
OleDbDataAdapter da = new OleDbDataAdapter(sqlStr,conn);
// Create a dataset object and fill with data using data adapter's Fill method
DataSet ds = new DataSet();
da.Fill(ds, "Employees");
// Hide the column and attach dataset's DefaultView to the datagrid control
ds.Tables["Employees"].Columns["LastName"].ColumnMapping = MappingType.Hidden;
dataGrid1.DataSource = ds.Tables["Employees"];
Alomgir Miah
Live Life King Size
|
|
|
|
|
Does anyone know a way to get the type names of custom attributes applied to a class when the assembly is loaded in ReflectionOnly mode?
The only method to get custom attributes that I know is Type.GetCustomAttributes; but since that returns attribute instances and not just the type name, it can't be used in ReflectionOnly mode.
I just want to make sure I'm not overlooking something before sending a suggestion to Microsoft.
|
|
|
|
|
|
ReflectionOnly mode means the type is loaded in "inspection context".
That is a .NET 2.0 feature to load assembly if you just want to reflect on them without creating types.
It's faster, doesn't lock the assembly file etc...
But you can't get instances from ReflectionOnly assemblies, so GetCustomAttributes() always results in an exception.
But I just found the solution myself: CustomAttributeData.GetCustomAttributes(type)[^] gets information about the attributes in a ReflectionOnly compatible way.
|
|
|
|
|
Hello,
If I have 5 tabcontrol windows on my Form1. Is there a way of
hiding some of those tabs?
Thank you
|
|
|
|
|
this.tabControl1.TabPages.Remove(this.tabPageToRemove);
Add it again when you need it
this.tabControl1.TabPages.Add(this.tabPageToRemove);
Alomgir Miah
Live Life King Size
|
|
|
|
|
hello
i am new in programming and also in C#. i have a problem regarding for loop in three dimentional array .
i am pasting piece of code in which i want to check that a value exists in array or not
rook_moves = new int[ 64 ][][];
rook_moves[ 0 ] = new int[ 2 ][];
rook_moves[ 0 ][ 0 ] = new int[ 7 ];
rook_moves[ 0 ][ 1 ] = new int[ 7 ];
rook_moves[ 0 ][ 0 ][ 0 ] = 1;
rook_moves[ 0 ][ 0 ][ 1 ] = 2;
rook_moves[ 0 ][ 0 ][ 2 ] = 3;
rook_moves[ 0 ][ 0 ][ 3 ] = 4;
rook_moves[ 0 ][ 0 ][ 4 ] = 5;
rook_moves[ 0 ][ 0 ][ 5 ] = 6;
rook_moves[ 0 ][ 0 ][ 6 ] = 7;
rook_moves[ 0 ][ 1 ][ 0 ] = 8;
rook_moves[ 0 ][ 1 ][ 1 ] = 16;
rook_moves[ 0 ][ 1 ][ 2 ] = 24;
rook_moves[ 0 ][ 1 ][ 3 ] = 32;
rook_moves[ 0 ][ 1 ][ 4 ] = 40;
rook_moves[ 0 ][ 1 ][ 5 ] = 48;
rook_moves[ 0 ][ 1 ][ 6 ] = 56;
if i want to search that '48' exists or not please tell me how i will implement it in C#
thanks
|
|
|
|
|
Ok i'm not 100% sure but i think something like this is what your asking for.
<br />
for (int i=0; i<64; i++)<br />
{<br />
for (int x=0; x<64; x++)<br />
{<br />
for (int z=0; z<64; z++)<br />
{<br />
if (rook_moves[i][x][z] == 48)<br />
return true;<br />
}<br />
}<br />
}<br />
This code, i'm pretty sure, would check every single slot in the Array for 48.
|
|
|
|
|
Hello,
I'd like to read in a few enviroment variables for an application that will automate a few tasks. VB has a function 'Environ' that can look up env variables with the key as the parameter. Is there anything simular in C#? It it's not possible through C# then I assume to use some api calls.
Thanks,
Bic2k
|
|
|
|
|
Yup, figured it out myself of course.
string path = System.Environment.GetEnvironmentVariable("PATH");
James
|
|
|
|
|
Please note that the environment variables created within the application will not be
available after the application exits.
|
|
|
|
|
|
hi ...i want to know tht how can we discover whole network in such a way that just enter the IP address, then discover and scan all devices and network attached to system and keep on scanning until reach at some dead end.
plz gime the hint how can we do ht in c#.net ...thank u
ingenious
|
|
|
|
|
Hi all,
In C# system service I need to get some string from MFC mainframe
window by SendMessage() API call. I managed to send message, but can
not find the way to return string to C# app.
I tried to use lParam:
C# side
StringBuilder sb = new StringBuilder(256);
SendMessage(process.MainWindowHandle, WM_GET_AUTH_MEMBER, 0, sb);
C++ side
CString member = "SomeString";
strcpy((char*)lParam, member.GetBuffer());
Then on C# side sb has not been changed
Any idea ?
Please if someone did it post the example,
I would greatly appreciate,
Roman
|
|
|
|
|
|
How can i make auto arrange for the desktop icons on my desktop using C#.net
kevin smoke
|
|
|
|
|
try this
private void button1_Click(object sender, System.EventArgs e)
{
SendMessage(GetDesktopWindow(), LVM_ARRANGE, LVA_SNAPTOGRID , 0);
}
public const int LVM_ARRANGE = 4118;
public const int LVA_SNAPTOGRID = 5;
[DllImport("User32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll")]
public static extern int SendMessage( IntPtr hWnd, uint Msg, int wParam, int lParam );
Alomgir Miah
Live Life King Size
|
|
|
|
|
thanks alot, it worked correctly.
kevin smoke
|
|
|
|
|
i had asked about the same later in the message board , but i didnt got an answer for it , till u give me a one, i did all u did except sending the right message 4118, so i am wondering is there any very detailed refrence for all windows messages with examples , i am using spy++, but sometimes i cant catch what i want exactly from it
so can u or any one here can give me the right way or refrence
thx alot in advance
|
|
|
|