|
Dear,
i have two different namespaces. i want to use one class of one namespace in another namespace. i tried with using keyword. but it is not working.
yogesh
|
|
|
|
|
You can't put a class name in a using, only the namespace.
using NamespaceTwo;
namespace NamespaceOne
{
public class ClassA
{
ClassB b1 = new ClassB();
NamespaceTwo.ClassB b2 = new NamespaceTwo.ClassB();
}
}
namespace NamespaceTwo
{
public class ClassB
{
}
}
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)
|
|
|
|
|
yogesh_softworld123 wrote: i tried with using keyword. but it is not working.
You need to be specific about exactly how it isn't working. I'm going to assume that you got an error that said something like Are you missing an assembly reference?
If they are then you have to add a reference to the assembly the class you want to use is contained in.
To do this, right click on the project (in the Solution Explorer) and select "Add reference..." in the context menu. In the dialog select the "Projects" tab and then select the project the class you want to use is in.
Your using should then work.
|
|
|
|
|
Make sure the class you're trying to use is marked as public , otherwise it won't be visible outside its namespace.
|
|
|
|
|
I have to list boxes...and i have a datagrid with binded to complete table..and i am using DataGridCombocolumn with displaystyle as nothing to display the values from master tables in relation instead of their IDs...
On selection change event of second list box i put this filter...values in both list boxes are selected...it shows correct values in debug mode........
MyBindingSource.Filter = "Column1="+cbCol1.SelectedValue+" AND Column2= "+cbCol2.SelectedValue;
it gives following error
Syntax error: Missing operand before 'And' operator.
|
|
|
|
|
You might be missing the ' (quote). Try it this way,
MyBindingSource.Filter = "Column1='"+cbCol1.SelectedValue+"' AND Column2= '"+cbCol2.SelectedValue+"'";
See the example here, Link[^]
|
|
|
|
|
When i am doing it like that it gives error cannot convert System.Int32 to System.String
Actually both are Primary key IDs in individual master tables....but the value coming here is string...If i am not using AND clause this is working fine with individual listbox filtering it is auto converting those strings...Its only then when i want to filter by values from both columns its creating prob...I am not facing any prob with combo box in the same situation.......Its the only list box thats irritating
|
|
|
|
|
(("Column1="+cbCol1.SelectedValue.ToString()+") AND (Column2= "+cbCol2.SelectedValue.ToString()));
This might work...
And one more thing.
it might be && inspite of AND
But not so sure. .
|
|
|
|
|
Hi All,
I am using C#. I have a empty Form. When i move mouse on the Form, i am displaying the x and y position of mouse using DrawString() method.
Graphics grx = e.Graphics;
string xy = "X: " + cursorPos.X.ToString() + "\nY: " + cursorPos.Y.ToString();
grx.DrawString(xy, font, brush, cursorPos.X, cursorPos.Y);
The above code snippet is in Paint event. Hence the x and y values move along with cursor.
My problem,
When i change the opacity of Form from 100% to 10%, the Form becomes transparent. Even x and y values (displayed using DrawString) becomes transparent (faint).
I want the x and y values to be displayed clearly even if Form is transparent. How can i achieve it?
Thanks in advance.
|
|
|
|
|
Hmmm not sure if will work but try the following...
Set the backcolor of your form to a color not used for you text, the set the tranparencykey to match.
then put a panel on your form with backcolor as Transparent.
then do your paint code to the panels Paint Event.
hopefully it will work
EDIT:
just tested and works fine, just need to set the FormBorderStyle to None
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Thank you very much for your help, but i am not getting the result.
Will you please elaborate? Have you set panel dock to fill?
|
|
|
|
|
ok this is all i did... the form contains only one panel, simply drag and dropped to design, set
Panel1.BackColor = Color.Transparent;
and double clicked Paint event handler, thats all i did to the panel
public Form1()
{
InitializeComponent();
this.BackColor = Color.Red;
this.TransparencyKey = Color.Red;
this.FormBorderStyle = FormBorderStyle.None;
}
void Panel1Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawString("SOME TEXT", Label.DefaultFont, Brushes.Blue, 0, 0);
}
when the form loads all i can see is "SOME TEXT" in blue on my screen
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Thank you.
Thanks a lot for your time and support. I am grateful to you.
|
|
|
|
|
A customer have an CRM with custom revision handling.
When I open, change and save a document (2007) I must force the custom revision on the document.
In the header I have 2 fields {AUTHOR \* MERGEFOMAT} and {INFO RevNum} that I need to update programatically using using Word = Microsoft.Office.Interop.Word
After a days serch I am bewildered. Does anyone know of a way to do this?
Java
C#
Gupta Team Developer 3.1
VC++ 2003
Oracle 8i79i
W2K-XP
|
|
|
|
|
WordDocument has a property called 'Fields' which is a list of Word.Field Type which has a function called Select()
I not sure but i would assume that would select the field for you to add text to
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Code like below below works. But I need to replace the text in a QuickPart in the header.
----
using System.Reflection;
using Word = Microsoft.Office.Interop.Word;
using System.Text;
namespace Word
{
public partial class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
public Form1() //constructor
{
InitializeComponent();
}
private void button1_Click(object sender, System.EventArgs e)
{
Word.Application app = new Word.Application();
if (textBox1.Text.Length > 0)
{
app.Visible = true; // krister
object template = Missing.Value;
object newTemplate = Missing.Value;
object documentType = Missing.Value;
object visible = true;
object nullvalue = Missing.Value;
object truevalue = true;
object falsevalue = false;
object filepath = "C:\\testdokument.docx";
Word._Document doc1 = app.Documents.Open(ref filepath,
ref nullvalue, ref nullvalue, ref nullvalue, ref nullvalue, ref nullvalue,
ref nullvalue, ref nullvalue, ref nullvalue, ref nullvalue, ref nullvalue,
ref nullvalue, ref nullvalue, ref nullvalue, ref nullvalue, ref nullvalue);
doc1.Words.First.InsertBefore(textBox1.Text);
}
object saveChanges = false;
object originalFormat = Missing.Value;
object routeDocument = Missing.Value;
app.Quit(ref saveChanges, ref originalFormat, ref routeDocument);
}
}
}
Java
C#
Gupta Team Developer 3.1
VC++ 2003
Oracle 8i79i
W2K-XP
|
|
|
|
|
A little known trick to help with MS Office automation by kubben gave me a good start
Java
C#
Gupta Team Developer 3.1
VC++ 2003
Oracle 8i79i
W2K-XP
|
|
|
|
|
Hello,
I am using the Smart client software factory(SCSF) to developing of an application.
I have created many views with UI.
By default When shell form loads..then..first view is loading into the shell form.
now i want to load second view form on shell application.
Can anybody help me how to solve this.
Thanks in advance,
|
|
|
|
|
Hi all,
I am using Sql server reporting services for creating reports. While using Sub reports I am getting error :-
Error sub report can't be loaded.What is the reason.Can anybody tell the solution of it
Thanks
|
|
|
|
|
can you tell me how can i build a tree in c#?
please show me source example
|
|
|
|
|
1. Dig a hole
2. Put Tree in
3. Put compost
4. Close with Sand
5. Throw water.
In a few years time you have a tree.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Earth.Soil.Dig( 30cm );
Earth.Soil.Plant( new Tree() );
Earth.Soil.Fill( new Compost(), 30cm );
Earth.Soil.Cover( new Sand() );
Earth.Soil.Water( WateringCan.Get() );
|
|
|
|
|
You all are going great....
|
|
|
|
|
Warning: Do not try this at home
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
|
|
|
|
|
Add a Treeview control, and use
tv.nodes.add
Thats all you need. Nesting can be done using node objects
|
|
|
|