|
I need to create simple query designer. because we need to give sql query designing part to our customers. The main headache to me is visualize the joining. I use custom controller (checkedListbox and button) to visualize the table. Please help me to do this.
Dushan Perera
|
|
|
|
|
I wrote a query designer way back. You can find the implementation at www.analysis6.com[^] it is not open source. Start looking for sources matching what you need and check out other implementations. Good Luck
Natza Mitzi
|
|
|
|
|
I'm building a custom control inherited from a picturebox control, and I would like it to automatically resize to the dimensions of the container control to which it is added(could be any valid container control)
Referencing the Parent of the custom control in its structure definition
Public MycustomePicBox()
{
this.Size=new System.Drawing.Size(this.Parent.Clientrectangle....
}
isn't possible because at the time the code executes, the custom control hasn't been added to the container control yet.
Is there an event that fires for a Control when it has been added to a container?
modified on Sunday, March 29, 2009 10:43 PM
|
|
|
|
|
I hope I haven’t got the wrong end of the stick of what you’re trying to achieve.
I’ve just had a quick look, and found that there’s an event available for when controls are added to a user control. Try using the ControlAdded Event.
To initialize it do the following…
<code>
public userControl1()
{
InitializeComponent();
/*
Please note, the code below should really be inside InitializeComponent();
But for speed, i've added it in here.
Add the line below…
Note: Press Tab key after typing in += as this will auto complete the rest of the event.
*/
this.ControlAdded+=new ControlEventHandler(userControl1_ControlAdded);
}
private void userControl1_ControlAdded(object sender, ControlEventArgs e)
{
// execute your methods for resizing to parent control.
}
</code>
I hope this has helped?
P.S. I am using the latest version of C#.Net framework 3.5 so I’m guessing that these events are also available for frameworks 1.1 and 2.
Rule 1 - Don’t break what’s not broken!
Rule 2 - Don’t reinvent the wheel… just give it a lick of paint!
Rule 3 - Keep plenty of programmer foods to hand… Pizza, beer & crisps... including the books on "How to Crash Your System in Twenty Seconds!"
|
|
|
|
|
I think that event fires for the container control.
|
|
|
|
|
Hello everybody.
How can I get this path with C# ?
%SystemRoot%\Microsoft.NET\Framework\
Thank you.
|
|
|
|
|
|
I prefer <a href="http://msdn.microsoft.com/en-us/library/system.environment.expandenvironmentvariables.aspx">Environment.ExpandEnvironmentVariables</a>[<a href="http://msdn.microsoft.com/en-us/library/system.environment.expandenvironmentvariables.aspx" target="_blank" title="New Window">^</a>]
|
|
|
|
|
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
|
|
|
|