|
Nice. I wasn't aware of it.
|
|
|
|
|
Hi,
If your question was not specifically about environment variables but instead about the directory containing the common language runtime then take a look at the System.Runtime.InteropServices.RuntimeEnvironment class.
The GetRunTimeDirectory method may be what you want.
Alan.
modified on Sunday, March 29, 2009 8:16 PM
|
|
|
|
|
Hi,
I'm new with C# and I have a little problem.
I'm trying to make button and when the user clicks the button,
textbox shows message "This works!"
However, nothing happens when the button is pressed down.
Could you please help me?
The code is listed below.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button NaytaTeksti;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
private void NaytaTeksti_Click(object sender, EventArgs e)
{
string text = "This works!";
textBox1.Text = text;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.NaytaTeksti = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// NaytaTeksti
//
this.NaytaTeksti.Location = new System.Drawing.Point(80, 88);
this.NaytaTeksti.Name = "NaytaTeksti";
this.NaytaTeksti.Size = new System.Drawing.Size(128, 23);
this.NaytaTeksti.TabIndex = 0;
this.NaytaTeksti.Text = "Nayta";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(96, 120);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.NaytaTeksti);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
|
|
|
|
|
Hi,
you have to add the following line into your InitializeComponent Method
this.NaytaTeksti.Click += new System.EventHandler(this.NaytaTeksti_Click);
otherwise your Event Handler is never called.
Regards,
Jens
|
|
|
|
|
Hi,
As JF2015 said, there is a line missing.
However, when using Visual Studio, you are not supposed to edit tje InitializeComponent() method, it is generated and managed by Visual Designer.
So either use the Visual Designer to add a click event to your button, or add the new line to your Form1 constructor, right after the call to InitializeComponent().
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
kiddo…… NaytaTeksti_Click(object sender, EventArgs e)
this event dosn't belong to any Control
here:
this.NaytaTeksti.Location = new System.Drawing.Point(80, 88);
this.NaytaTeksti.Name = "NaytaTeksti";
this.NaytaTeksti.Size = new System.Drawing.Size(128, 23);
this.NaytaTeksti.TabIndex = 0;
this.NaytaTeksti.Text = "Nayta";
this.NaytaTeksti.Click+=new System.EventHandler(this.NaytaTeksti_Click);//please add this
Who knows most speaks least
|
|
|
|
|
Hi! Is there a way to acquire the letters from the grid of this game:(it is in Bulgarian)
The game is:http://bezumie.com/dumino/[^]
In the text field you write a player name. Then you click the button next to it - "ВХОД". When the page loads there is a grid, which eventually fills with Cyrillic characters. How can I get the characters with a C# application???
Via Firefox I saw the page source. There is a board array which contains the characters. But I don't know how to access the information with my program.
Still learning...
|
|
|
|
|
well, this is bad idea to do this on sites...but a little hint, that input element id is 'fld'.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello everybody
i have a treeview it has set of nodes , i want to set some of them visable to false , but i can't find visable or enable proprty
what can i do please
thnks for help
M.Elkholy
MD_NADA
|
|
|
|
|
no, there is no property exists in TreeView to hide a node but you can remove a node.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
thanks for your replay
but i need the nodes hiden i cant remove it becouse i depend on it in my code
MD_NADA
|
|
|
|
|
Just because you need the nodes hidden doesn't mean that you can do it - you may need to investigate a third party control to see if you can find this feature there.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Another possible solution is to handle the OnBeforeSelect event of the TreeView . Check the Node passed in the TreeViewCancelEventArgs and if it is one that you would like disabled, use the Cancel property from the TreeViewCancelEventArgs to stop user interaction. Of course it might be polite to give the user a notification for the reason.
Alternatively combine the above, without the user notification, with drawing the nodes that should be disabled yourself in a dimmed-out style.
Investigate the DrawMode property of the TreeView to find out how.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi
I want to list folders,subfolders and files from all drives in a system.I tried a code which works well for C:\.I want the same for the other drives.I have listed the drives in listbox.Please give your suggestions.
private void PaintList(String sss)
{
try
{
reader = new XmlTextReader("path.xml");
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Text:
String s1;
s1 = reader.Value;
String ss;
ss = listBox1.SelectedItem.ToString();
sss = ss + s1;
object o3 = (object)sss;
DirectoryInfo dire = new DirectoryInfo(sss);
if (dire.Exists)
{
String[] folder;
folder = Directory.GetDirectories(sss);
foreach (string foldername in folder)
{
DirectoryInfo di = new DirectoryInfo(foldername);
if (di.Exists)
{
String[] files;
files = Directory.GetFiles(foldername, "*.exe*");
foreach (String filename in files)
{
lvi = new ListViewItem();
lvi.Text = filename;
listView1.Items.Add(lvi);
lvsi = new ListViewItem.ListViewSubItem();
lvsi.Text = filename.Length.ToString();
lvi.SubItems.Add(lvsi);
}
this.Controls.Add(listView1);
}
}
}
break;
}
}
}
catch (System.Exception err)
{
MessageBox.Show("Error: " + err.Message);
}
}
|
|
|
|
|
use Directory.GetLogicalDrives()
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi
I am getting the list of all the drives.I am able to list the files for C:\.I want to do the same for the other drives.The index of the list should change.If i use the following i have to do the same coding inside each if statement.Can you give some alternative
int r=listBox1.SelectedIndex;
if(r==0)
{
}
if(r==1)
{
}
|
|
|
|
|
string[] drives = Directory.GetLogicalDrives();
for(int a=0;a<drive.length;a++)>
{
}
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
hello every one,
Well i have big problem whn i m debuging my Project. it gives me Exception"Only MySqlParameter objects may be stored".......
this is my cs file code.
public int ExecuteNonQuery(string storedProcedure, MySqlParameter[] parameterArray, MySqlParameter outputParam)
{
int result;
MySqlCommand comm = null;
string msg;
result = 0;
try
{
//ValidateConnectionString();
//conn = new SqlConnection();
//conn.ConnectionString = _connectionString;
comm = _connection.CreateCommand();
//conn.Open();
comm.CommandText = storedProcedure;
comm.CommandType = CommandType.StoredProcedure;
foreach (MySqlParameter param in parameterArray)
{
comm.Parameters.Add(param);
}
outputParam.Direction = ParameterDirection.Output;
comm.Parameters.Add(parameterArray);
result = comm.ExecuteNonQuery();
result = int.Parse(outputParam.Value.ToString());
}
this line is Exception// catch (Exception ex)
{
msg = ex.Message;
}
finally
{
comm = null;
}
// result = SqlHelper.ExecuteNonQuery(_connectionString, CommandType.StoredProcedure, storedProcedure, parameterArray);
return result;
}
please tell me what should i do solve this problem ......
reply me as soon as posible
thanks in Advance
Naim Khan
|
|
|
|
|
http://www.devart.com/dotconnect/mysql/docs/Parameters.html
|
|
|
|
|
naim khan wrote: comm.Parameters.Add(parameterArray);
You're trying to put an array of them in; you can't do that with Add.
You could use a foreach loop to add them; that also allows you to verify that they're not null and such.
|
|
|
|
|
Hi.
I'm gonna create a list with all classes and namespaces name in .NET Framework 3.5 (Programmatic)?
Would you guide me how I can do it ?
Thank you.
modified on Sunday, March 29, 2009 8:35 AM
|
|
|
|
|
Mohammad Dayyan wrote: I'm gonna create a list with all classes and namespaces name in .NET Framework 3.5 ?
Why?
Mohammad Dayyan wrote: Would you guide me how I can do it ?
Not guide you, but I can suggest two starting points for your research;
- Reflection
- Scraping the MSDN site[^]
I are troll
|
|
|
|
|
|
Mohammad Dayyan wrote: Programmatic !
I guessed as much since you're on a programming forum. Let me rephrase;
- Reflection
That's like asking the ".NET Framework" that's installed on your PC what the names of the classes are that are in it. It's like asking the system itself, "what's the stuff inside you?"
- Scraping MSDN
That's like programmatic reading the website of Microsoft that lists and describes your classes. This way you'd be building something that reads webpages.
You still haven't answered my original question; why do you want to make this list?
I are troll
|
|
|
|
|
You can use Reflection to iterate through all classes and namespaces in the assemblies you wish to explore.
|
|
|
|