|
Take a look at the Interop classes provided by Microsoft for interacting with Word and Excel etc. Although these will require that Word is installed on the same machine. Alternatively there are some controls available on the internet (both free and commercial) that will do spell checking for you.
|
|
|
|
|
Hi,
I am using Panasonic KX-TEM824 PABX board. I want read data using C#.NET.
I used Serial Port package in C#.NET 2.0. But its not receiving any data.
Please give me a soloution.
THnx in advance
Thnx
Naffi
|
|
|
|
|
Hi Naffi,
I have a few questions:
1). Which operating system are you using with your PBX?
2). Are you using the Programmator software with your hardware?
3). Which version of Visual Studio are you using? I assume you are using VS 2005+ for the serial port support.
4). Are you receiving any data at all at the port?
Try connecting the hardware to your computer and use hyperterminal to determine if you are receiving data to the port.
Ron Birkelbach
Kennebec, Inc.
|
|
|
|
|
need help
how do I insert values into textbox exists in word-xp document using c# .net framework 1.1 (vs2003)
I don't want to use the VSTO
thank you,
|
|
|
|
|
You could possibly get the handle of the window through WinAPI and then send the text to the window using WinAPI, I believe the command that you would use is SendMessage.
Regards,
Thomas Stockwell
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.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi to all, i'm a Biogenetic student and i don't know anything about programming.
Now, i'm looking for someone that can help me to implement some simple phylogenetic algorithms that construct phylogenetic relationship among biological sequences.
There are some kinds of algorithms, such as the follow: Clustering Algorithms, Cladistic methods. I haven't limitation in programming about one algorithm in particular.
What i found is a simple program that draw, in a Windows Form, the output of one o this methods.
Please help me.
|
|
|
|
|
Huh Ehm ... try to clearify a bit ... I'm lost
|
|
|
|
|
I am trying to create a class which other classes can use for passing info to the main form, called: class InfoDisplay:
<code>
class InfoDisplay
{
public delegate void ehMainInfoShow(string s);
public event ehMainInfoShow evtMainInfoShow;
public InfoDisplay()
{
// do nothing
}
public void ShowMainInfo(string s)
{
evtMainInfoShow(s);
}
}
</code>
In my main form's constructor, I have the following (for linking the delegate to the function I think?):
<code>
...
private InfoDisplay m_infoDisp;
public MainForm() // Constructor
{
InitializeComponent();
InfoDisplay m_infoDisp = new InfoDisplay();
m_infoDisp.evtMainInfoShow += new InfoDisplay.ehMainInfoShow(ShowMainInfo);
}
private void btnTest_Click(object sender, EventArgs e)
{
m_infoDisp.ShowMainInfo("Updating file info");
}
private void ShowMainInfo(string s) // Linked to InfoDisplay class for passing data back to Mainform
{
txtBoxInfo.AppendText(s + "\n"); //this puts an annoying square at the end of the line ( ? )
}
</code>
When I click the button which calls the method btnTest_Click, it works fine (outputs the string "Updating file info", to the text box).
However, when another class (all in the same namespace), DataFetcher, below, attempts to create a new InfoDisplay object and call the method ShowMainInfo(), an error results:
<code>
class DataFetcher
{
private InfoDisplay m_infoDisp;
public DataFetcher()
{
m_infoDisp = new InfoDisplay();
}
public void GetData(string fileName)
{
m_infoDisp.ShowMainInfo("Loading file...");
...
// Error occurs on the above line (when the method is called from another class that has created an instance of this one):
// "Object reference not set to an instance of an object."
</code>
If anyone has any help with this problem I'd really appreciate it... Is there a delegate declaration missing somewhere - or perhaps its not possible
to have this arrangement of a general 'proxy' class for passing info to the main form via events..?
Many thanks for any help!
Gerry
C# newbie
Put A Smile On Your Face
http://www.thecrazywebsite.com
|
|
|
|
|
The problem is that no event handlers are registered to the evtMainInfoShow event when you call ShowMainInfo in the DataFetcher class. Why? Simply because in the DataFetcher you're cteating a new instance of the InfoDisplay class that does not now you registered an event handler to the instance created in the main form. To overcome the problem of the exception being thrown when you call ShowMainInfo you have to check whether there are any event handlers registered to your event before calling it. Its common practise to encapsulate this in a protected OnEvent method:
class InfoDisplay
{
public delegate void ehMainInfoShow(string s);
public event ehMainInfoShow evtMainInfoShow;
public InfoDisplay()
{
}
public void ShowMainInfo(string s)
{
evtMainInfoShow(s);
}
protected void OnMainInfoShow(string s)
{
if (evtMainInfoShow != null)
evtMainInfoShow(s);
}
}
Besides that change I suggest you also create a special EventArgs class that carries the string message and name this class and the delegate so they conform to the common naming pattern (eventHandler and eventArgs).
To overcome the problem of creating multiple instance of the InfoDisplay class, I'd suggest you let the class implement the singleton pattern so there exists only one instance that is accessible throughout your application. Let the main form register to the event of this instance and all other classes call ShowMainInfo.
"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
|
|
|
|
|
Phew!
Thanks a million Stefan, I think I see what you mean (ie. what the problem is).
OK I'm gonna try and get my head around this singleton pattern
(If you have any links to a good source of info on how to do this, that'd be awesome!)
Mit freundlichen grussen (I used to live in Frankfurt, I miss Germany! Nice site you got btw, impressive Vitae! )
Gerry
|
|
|
|
|
gvanto wrote: I think I see what you mean (ie. what the problem is).
That's always a good starting point
gvanto wrote: If you have any links to a good source of info on how to do this, that'd be awesome!)
Take a look at this Implementing Singleton in C#[^]. IIRC there are also some articles on singletons here on Codeproject. As a last resort, google should bring up tons of information.
"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
|
|
|
|
|
Hi
I want to create an application for a certain use and I wanted to know if it's possible.
I have my conatct list in my office outlook.
The thing is, when I'm sending mail to all of my contacts I want to be able to send the email to 25 contacts in each shipping. I want to send to 25 conatcs and to the next 25 contacts and so on... each time. Untill I sent the mail to all of my contacts.
Is it possible to do it in .NET C#?
If so, can you give me some kind of direction on how to do it?
thanks in advance
|
|
|
|
|
I have noticed that I can use the Microsoft.Office.core; namespace to interact with outlook.
I also saw some examples in msdn2 that I should use Microsoft.Office.Interop.Outlook; but it's like it doesn't exist. I can't get the Microsoft.Office.Interop.Outlook.Application class to create a new outlook application.
|
|
|
|
|
Hi,
I use textboxes to log application messages sometimes, and want them to stay scrolled to the bottom (most recent message). How can this be achieved?
I've tried both textbox.text += "my message", and textbox.appendtext("my message") - they don't perform the behavior I'm after.
Thanks for any ideas,
cdj
|
|
|
|
|
try using this:
textbox.text= "my message" + textbox.text
hopes it helps,
Wachill
Signature has been encrypted
|
|
|
|
|
It would, were I willing to accept reverse chronological order.
Thanks though!
|
|
|
|
|
Try calling ScrollToCaret after appending the new text.
"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
|
|
|
|
|
Stefan is right. ScrollToCaret is what you're looking for. The only pitfall to using it, though, is that the TextBox has to have the input focus in order for it to work. Call the Focus method on the TextBox before you call ScrollToCaret .
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Ah! I've tried scrolltocaret before, and noticed that it did absolutely nothing. It must be the focus-thing that bit me. I'll try scrolltocaret in combination with giving the textbox the focus.
Hm. It occurs to me: if the textbox MUST have focus in order for scrolltocaret to be effective, doesn't that mean it would be difficult to specialize the textbox class into a textbox + AutoScrollToBottom property class - no?
Thanks a bunch everyone!
|
|
|
|
|
It's possible to make a Textbox that autoscrolls, but you'd have to send the textbox window handle the appropriate window messages to get it to scroll.
The reason why the ScrollToCaret function needs the TextBox to have the focus is because it depends on the existance of the caret. The caret doesn't exist in the TextBox until the TextBox has the focus.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hm - Looking into the prospects for an autoscroll textbox property, and I came across the dotnet scrollablecontrol class, which apparently textbox doesn't n-inherit from.
http://msdn2.microsoft.com/en-us/library/system.windows.forms.scrollablecontrol.aspx
Cute little learning project: determine exactly what's involved with deriving from textbox to include an autoscroll property.
Thanks!
|
|
|
|
|
ScrollableControl doesn't do what you think it does. It doesn't automatically scroll to the bottom or anything like that. It supplies scrollbars that automatically appear if the content of the child controls exceeds its boundries.
There are currenly two controls and two components that are direct inheritors of this class: Panel and ToolStrip, and ContainerControl, and Design.ComponentTray.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Oh. Boy is the name "autoscroll" misleading for a property then.
Thanks!
|
|
|
|
|
Hey guyz, any idea about how to get pix from camera??
Thanx a bunch
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
If it's a Canon, read my article on the Canon SDK. Otherwise, WIA is your best bet.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|