|
Hello,
Normaly the correct usage of anchor and dock property from the controls should solve this problem.
May you can give a more detailed example.
All the best,
Martin
|
|
|
|
|
He Martin
i don't know what to info should i give you. Lead me if you can.
anyways i will try to change the anchor and dock properties. It need some time. So if it didn't work i will repost tomorrow.
Thanks
|
|
|
|
|
Hi,
When you set the size for each and every control, give in terms of percentage(%) instead of giving the exact size
Regards,
Sylvester G
|
|
|
|
|
And how can i calculate the percentage size if i have the size in pixcels??
|
|
|
|
|
I would prefere skaling! (Control.scale)
|
|
|
|
|
hey martin, your following me everywhere
thanks for the replies
Martin# wrote: I would prefere skaling! (Control.scale)
I will try that. i have never used it before so i am having a search on google and MSDN to find some methods for using it. If you have any link for that please tell me about.
thanks again
|
|
|
|
|
|
Hi all,
I have a peculiar problem in my application.
I have developed a .net windows application that interacts with a third party dll named Ltws32.dll to connect to the database HP9000 and fetch data.
I have been working with it since 3 months.
Application is completely developed and pakaged also.
Now, the first time i try to fetch data, the connection is aborting .
From the second attempt it is working fine.
This happens only the first time when the application is launched.
Another strange behavior is ,it happens only if i compile the application in release mode.In debug mode its working fine.
The connection to the database is getting established but when i try to send data to the open connection ,it fails.
What can be the reason?
Thanks.
|
|
|
|
|
have two Forms in C#. ie Form1 and Form2, Form1 contains one textBox Control. and Form2 contain one Button Control. When i press a Button of Form2 then i want the textBox of form1 will display like="Hello". is it possible ?
plz give me idea?
Sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
You've asked exact the same thing 6 minutes ago and already got answers. Do not spam the forum!!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Yes, it is possible. If you have two forms in the same application then on the button click event of form 2 u can write the code like
Form frm = new Form1("Hello") // Define overloaded constructor for Form1.
frm.ShowDialog();
In form1, simply do like
public Form1(string msg)
{
this.str = msg;
}
txtBox1.Text = this.str;
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
i have two Forms in C#. ie Form1 and Form2, Form1 contains one textBox Control. and Form2 contain one Button Control. When i press a Button of Form2 then i want the textBox of form1 will display some message like="Hello". is it possible ?
plz give me idea?
Sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
|
|
Sanjib Raj wrote: s it possible ?
It is one of the basic things in Object Oriented programming.
just if you create Form2 from Form1 give a reference of form1 to form2 and have a public function in form1 that sets the text in the textBox, Vica versa
|
|
|
|
|
**TEST_TABLE
ID Name Surname
-- ---- -------
3 Jack Black
4 Marry Green
5 John Wall
I fill combobox like this;
comboBox1.ValueMember = "id";
comboBox1.DisplayMember = "name";
comboBox1.DataSource = obj; //obj is IList
So, combobox filled and show "Name"s.
How can I get selected value's ID from combobox.
For example, if I select "Marry" on the combobox, how can I get "4"?
Best Regards...
|
|
|
|
|
|
comboBox1.SelectedIndex is return selected value index number.
For example my Database (table) like this;
**TEST_TABLE
ID Name Surname
-- ---- -------
3 Jack Black
4 Marry Green
5 John Wall
If I fill the comboBox and I select the "Marry" So comboBox1.SelectedIndex return "1"
But I want to get ID. (I want to get "4" in this example).
|
|
|
|
|
Sorry,
Didn't looked at youre question carefully.
Have no experience with the binding of Database.
|
|
|
|
|
comboBox1.SelectedValue.toString()
|
|
|
|
|
comboBox1.SelectedValue.toString() --> Its return class name.
This are not work;
Convert.ToInt32(comboBox1.SelectedValue)
(string)comboBox1.SelectedValue;
comboBox1.SelectedItem.ToString();
comboBox1["id"];
comboBox1.SelectedItem["id"];
comboBox1("id");
comboBox1.SelectedItem("id");
|
|
|
|
|
And this is not work;
try
{
object o = comboBox1.SelectedValue;
int i = Convert.ToInt32(o);
}
catch (Exception ex)
{
DataRowView o = (DataRowView) comboBox1.SelectedValue;
int i = Convert.ToInt32(o["id"]);
}
|
|
|
|
|
comboBox1.SelectedValue.ToString()
Works great!
|
|
|
|
|
comboBox1.SelectedValue.ToString() is Return Namespace name and Class name
|
|
|
|
|
You said you are using DataBase..
See the code bellow this is what I used :
namespace C_TestProject
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent(); ' Contains
}
private void Form1_Load(object sender, EventArgs e)
{
this.dB1TableAdapter.Fill(this.dbTestDataSet.DB1);
}
private void button1_Click(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex >= 0)
MessageBox.Show(comboBox1.SelectedValue.ToString());
}
}
}
// code Inside InitializeComponent()
this.components = new System.ComponentModel.Container();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.button1 = new System.Windows.Forms.Button();
this.dbTestDataSet = new C_TestProject.DbTestDataSet();
this.dB1BindingSource = new System.Windows.Forms.BindingSource(this.components);
this.dB1TableAdapter = new C_TestProject.DbTestDataSetTableAdapters.DB1TableAdapter();
((System.ComponentModel.ISupportInitialize)(this.dbTestDataSet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dB1BindingSource)).BeginInit();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.DataSource = this.dB1BindingSource;
this.comboBox1.DisplayMember = "EmpName";
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(62, 29);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
this.comboBox1.ValueMember = "ID";
//
// button1
//
this.button1.Location = new System.Drawing.Point(62, 90);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(121, 23);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// dbTestDataSet
//
this.dbTestDataSet.DataSetName = "DbTestDataSet";
this.dbTestDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
//
// dB1BindingSource
//
this.dB1BindingSource.DataMember = "DB1";
this.dB1BindingSource.DataSource = this.dbTestDataSet;
//
// dB1TableAdapter
//
this.dB1TableAdapter.ClearBeforeFill = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(243, 229);
this.Controls.Add(this.button1);
this.Controls.Add(this.comboBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.dbTestDataSet)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dB1BindingSource)).EndInit();
this.ResumeLayout(false);
|
|
|
|