|
The easiest way is to have a custom event in Form1 that you raise when you've validated the path, passing the path as an argument in a custom class derived from EventArgs. FormMain can subscribe to that event.
Form2 should have a method, something like public void UpdateImageFromPath(string path){ }. Call that method from FormMain in the event handler for your Form1 custom event.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Thank you all ..... I really appreciated every replay ....
I will try what you have said , seems there are a lot of ways
thank you ...........
I know nothing , I know nothing ...
|
|
|
|
|
|
Thank you so much, I have voted for your answer Mr.Giorgi Dalakishvili
I know nothing , I know nothing ...
|
|
|
|
|
You are welcome
|
|
|
|
|
Hello...
Are there any possibilities to use SerialPort Class for communicating with a device using RS485 ?
In google, I cannot find something, that help me.
|
|
|
|
|
It won't work with a RS485 device unless you have some converter, or some other RS485 library, to convert the signals between RS232 and RS485.
|
|
|
|
|
i want to read data from bio matrix machine
i konw the machine ip and port number
|
|
|
|
|
OK, you can use a TcpClient[^] to connect to it and the vendor's API to get the information that you want out of it. If you want more specific help post a more specific question.
|
|
|
|
|
|
I just tried it and couldn't duplicate the problem. It would appear as though you have a second control in the tablelayout, or there is something else drawing another gradient.
|
|
|
|
|
Hi..
i am using inbuilt crystal report of .net2005.
i want combobox instead of text when we ask for any parameter in discrete value window.
i am new wid this.Please help me!!
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Microsoft.AnalysisServices;
using Microsoft.DataWarehouse.Interfaces;
using System.Data.OleDb;
using System.Data.Common;
namespace DatabaseApplication
{
public partial class Form1 : Form
{
string dbname;
string connectionstring;
string databasename;
string datasourceviewname;
string datasourcename;
string tableName;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
string connstring = "Data Source=localhost;Integrated Security=True";
SqlConnection connection = new SqlConnection(connstring);
string query = "select * from sys.databases";
SqlDataAdapter data = new SqlDataAdapter(query, connection);
DataTable dtable = new DataTable();
try
{
connection.Open();
int records = data.Fill(dtable);
if (records > 0)
{
foreach (DataRow dr in dtable.Rows)
{
//Console.WriteLine(dr[0]);
comboBox1.Items.Add(dr[0]);
}
}
}
catch (SqlException sqlexcp)
{
MessageBox.Show("connection error");
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
dbname = comboBox1.Text;
}
private void button1_Click(object sender, EventArgs e)
{
/*databasename = dbname;
datasourceviewname = "oor";
connectionstring = "Data Source=localhost;Integrated Security=True";
//create a datasource name
RelationalDataSource newDS = new RelationalDataSource(datasourceviewname, Utils.GetSyntacticallyValidID(datasourceviewname, typeof(RelationalDataSource)));
Database db = new Database("oor");
db.DataSources.Add(newDS);
newDS.ConnectionString = connectionstring;
newDS.Update();*/
Server server = new Server();
databasename = "cwh_temp";
server.Connect("localhost"); // connection to the MS Analysis service engine
Database db = new Database(databasename, Utils.GetSyntacticallyValidID(databasename, typeof(Database)));
if (server.Databases.ContainsName(databasename))
server.Databases.RemoveAt(server.Databases.IndexOfName(databasename));
server.Databases.Add(db);
db.Update();
connectionstring = "Provider=SQLNCLI.1;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=rmcwh_alevoor";
datasourcename = "ooru";
RelationalDataSource dsNew = new RelationalDataSource(datasourcename, Utils.GetSyntacticallyValidID(datasourcename, typeof(RelationalDataSource)));
db.DataSources.Add(dsNew);
dsNew.ConnectionString = connectionstring;
dsNew.Update();
datasourceviewname = "ooru";
DataSourceView dsv;
dsv = db.DataSourceViews.Add(datasourceviewname, Utils.GetSyntacticallyValidID(datasourceviewname, typeof(DataSourceView)));
dsv.DataSourceID = dsNew.ID;
OleDbConnection cn = new OleDbConnection(dsNew.ConnectionString);
tableName = "UdayPareekScale";
//dss.Tables[1].TableName = "Folder";
try
{
OleDbCommand cmd = new OleDbCommand("Select * from [" + tableName + "]", cn);
OleDbDataAdapter ad = new OleDbDataAdapter(cmd);
DataSet dss = new DataSet();
ad.FillSchema(dss, SchemaType.Source);
dss.Tables[0].TableName = tableName;
dsv.Schema.Tables.Add(dss.Tables[tableName].Clone());
}
catch (NullReferenceException nre)
{
MessageBox.Show(nre.ToString());
}
catch(Exception exp)
{
MessageBox.Show(exp.ToString());
}
//dsv.Schema.Tables.Add(dss.Tables["Folder"].Clone());
dsv.Update();
}
}
}
|
|
|
|
|
Where do you get an error? wich line?
|
|
|
|
|
|
and that line would be.....???? Notice, in your original post, you didn't supply any lines numbers!
|
|
|
|
|
i've highligthed and underlined the line that was giving me a nullreference exception.
|
|
|
|
|
then use your IDE's editor to investigate line 140 (you have turned on "display line numbers" I trust).
whatever object reference gets dereferenced (as in myObject.something) is a candidate for being null and generating said exception.
|
|
|
|
|
how to call functions like this
private void inputCheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e )
from another functions
|
|
|
|
|
you can do it like a classic call
|
|
|
|
|
Usually any functionality i have in an event handler that will be used by anything other than any events it is assigned to i would put in a separate method, which can then be called directly. But that's a suggestion rather than an answer so...
You could try to call it like any other method, i.e.
inputCheckedListBox_ItemCheck(this, new ItemCheckEventArgs());
...but as i said i would never need to do this so i cant say for sure it would work.
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Thanks for your suggestion and help. But i didnt work.
Well why i need this as i want to get selected item in arraylist from chekbox list. For that i want to CHECK whether item is selected or not.
if you could help me out in that...
|
|
|
|
|
Try this one
put this code in your function where u want to call the function
object mysender = new object();
ItemCheckEventArgs mye = new ItemCheckEventArgs();
inputCheckedListBox_ItemCheck(mysender,mye);
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
It didnt work..
error ItemCheckEventArgs():"it wont take zero value"
|
|
|
|
|
try this...
object mysender = new object();
ItemCheckEventArgs mye = new ItemCheckEventArgs(0, CheckState.Checked, CheckState.Checked);
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|