|
Hello!
Does anybody know how to insert text into bookmarks in Word using late binding? If I use early binding everything works fine.
What I want to implement is somthing like this:
for (int i = 1; i <= document.Bookmarks.Count; i++)
{
object objI = i;
document.Bookmarks.get_Item(ref objI).Range.Text = "Some text";
}
but using late binding instead.
Tommy Fransson
|
|
|
|
|
Hi
I use OleDb to access MSAccess database, allways successfuly with out password, but when I set database password from Access (menu-> Tools-> security-> Set Access Password )it fails to connect even if i use the same password in the connection string such as:
conStr = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;password=<thepassword>;Data Source="+ DataDir + DataBaseName + .....
the error message is [cannot start your application. The workgroup information file is missing or opened exclusively by another user.]
is there any way to set a pass word for a data base so it can not be opened from access and available from the application please?
|
|
|
|
|
In Javascript, I used this method to open a browser: window.open(URL) but I dont know how to use this way to open a new window in C# (Im writing a web page using ASP.NET with C#). Can u tell me about this?
Thank you in-advance!
|
|
|
|
|
You still have to use your javascript code, cause ASP.NET is a server-side technology and therefor cannot provide a functionality like window.open .
www.troschuetz.de
|
|
|
|
|
Hi
In my code I have:
ICodeCompiler compiler = codeProvider.CreateCompiler();
And a warning appears in VC# 2005 saying:
'System.CodeDom.Compiler.CodeDomProvider.CreateCompiler()' is obsolete: 'Callers should not use the ICodeCompiler interface and should instead use the methods directly on the CodeDomProvider class. Those inheriting from CodeDomProvider must still implement this interface, and should exclude this warning or also obsolete this method.'
How can I sort this out?
Thanks
|
|
|
|
|
Just use the CodeDomProvider class directly as it suggests.
- Nick Parker My Blog | My Articles
|
|
|
|
|
I want my application to run most of the time as just an notify icon visible in the system tray, with some dialogs that pop up if the user selects an option from the context menu on the tray icon. I've had a look at the example on code project that creates an application that runs in the system tray:
http://www.codeproject.com/csharp/desktop_mail_checker.asp
So I copied how the above article sets up the main form: the form's FormBorderStyle to none, set it to minizied, disable the titlebar controls (maximize, minimize, close etc). It was all fine until I noticed that the form was visible in the Alt-Tab menu and once you had alt-tabbed to it there was no way of hiding it again
After a bit of googling I discover if I set the Form's FormBorderStyle to FixedToolWindow then it was no longer visible in the Alt-Tab menu, result! But today I have noticed that now I can no longer minimize or hide the form it appears as a minizied tool window in the bottom left of my desktop when the application is running and even worse if the user double clicks on the title bar the window expands to its normal size, apart from the form is empty and there's no way to minimize it again!
Anyone got any ideas as to how to completely hide form so its not visible as a window on the taskbar or on the alt-tab menu? All I want is my application's icon in the system tray while its running and a context menu for the icon. I don't really need the main form at all!
Cheers,
CoffeeZombie
|
|
|
|
|
use the form's Visible property. U dont need to change BorderStyles or anything.
A sample code could be (in this example I want the app to minimize to taskbar):
private void Form1_LocationChanged(object sender, EventArgs e)
{
if (this.WindowState==FormWindowState.Minimized)
{ notifyIcon1.Visible=true;
this.Visible=false;
}
}
A better solution when ur main form does not serve any purpose as in your case, is to not use any main form at all and create your own ApplicationContext. An example would be:
public class AppStart:System.Windows.Forms.ApplicationContext
{
[STAThread]
static void Main()
{
Application.Run(new AppStart());
}
NotifyIcon myIcon;
public AppStart()
{
myIcon=new NotifyIcon();
myIcon.Icon=SystemIcons.Information;
myIcon.Visible=true;
myIcon.DoubleClick+=new EventHandler(myIcon_DoubleClick);
}
private void myIcon_DoubleClick(object sender, EventArgs e)
{
Form1 myForm=new Form1();
myForm.Closed+=new EventHandler(appForm_Closed);
myForm.Show();
myIcon.Visible=false;
}
private void appForm_Closed(object sender, EventArgs e)
{
((Form)sender).Closed-=new EventHandler(appForm_Closed);
myIcon.Visible=true;
}
}
|
|
|
|
|
Aha! I knew there would be some way of getting rid of the main form completly! I just could not work out what the name of said object/class would be and now I know, an applicationcontext!
Cheers!!
|
|
|
|
|
i'm writing a messenger program but i don't know how to active the form like yahoo when have a new message arrives. is there any way to slove this problem
|
|
|
|
|
is there any method to get items in "applications tab" in "windows task manager"
|
|
|
|
|
I don't know if the BCL provides a method to do so, but the EnumWindows API funcion provides that functionality. The idea is only to enumerate the visible top level windows.
You can call this routine in C# through P/Invoke.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
is there any method to insert gif image (not bitmap) into richtextbox ?
|
|
|
|
|
|
i created a user control that has a collection as a property when i add the control to a form i can see the collection in the control properties and i can bring up the collection editor however everything is disabled how to i enabled so i can add new strings via the collection editor in the properties window.
thanks
|
|
|
|
|
I need an example about how can I view an jpg image file and write it into a file in C#.net.
Especially if I want to download jpg from an internet url by http.
Or how can I create a bitmap or image object directly from the url adress, I tried stream objects but couldn't manage it. If it is not possible, how can I save an image file from a http url? then I can use it to create bitmap object. Please give an example code...
|
|
|
|
|
|
I am trying to send email using the simple mapi. I cannot download the example because the server seems to be unavailable, so I wonder if anyone can help.
The problem I have is how to handle the MapiRecipDesc field in the MapiMessage structure. Apart from this it all works except I can't fill the Address field. I have the following declarations
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public class MapiMessage
{
public uint ulReserved=0;
public string lpszSubject="";
public string lpszNoteText="";
public string lpszMessageType="";
public string lpszDateReceived="";
public string lpszConversationID="";
public uint flFlags=0;
public MapiRecipDesc lpOriginator;
public long nRecipCount;
public MapiRecipDesc lpRecips;
public ulong nFileCount=0;
public MapiFileDesc lpFiles;
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
public class MapiRecipDesc
{
public ulong ulReserved=0;
public ulong ulRecipClass=0;
public string lpszName="";
public String lpszAddress="";
public ulong ulEIDSize=0;
public IntPtr lpEntryID = IntPtr.Zero;
}
and in the body I do
public const uint MAPI_TO=1;
MapiMessage message= new MapiMessage();
MapiRecipDesc recipDesc =new MapiRecipDesc();
recipDesc.ulRecipClass = MAPI_TO;
recipDesc.lpszName = "Fred";
recipDesc.lpszAddress = "someone@somewhere"
message.lpszSubject = "test subject";
message.lpszNoteText = "test message";
message.nRecipCount = 1;
message.lpRecips = recipDesc;
Ray
|
|
|
|
|
Hi I’m going to decrypt a string that my supplier is going to send to my aspx-page.
I’ve got the key to use when I decrypt using Rijndaels algorithm.
I think I should use the System.Security.Cryptography.RijndaelManaged class but have problem setting the Key property.
Here Is my code:<br />
<br />
RijndaelManaged myRijndael = new RijndaelManaged();<br />
byte[] key;<br />
char[] base64CharArray = new char[16];<br />
base64CharArray = "1234567890123456".ToCharArray();
<br />
string base64String = new string(base64CharArray);<br />
<br />
key = Convert.FromBase64String(base64String);
I got the following runtime error:
An unhandled exception of type 'System.FormatException' occurred in CryptoDev.exe
Additional information: Invalid character in a Base-64 string.
_____________________________
...and justice for all
APe
|
|
|
|
|
hi
now am going to have a traffic network map from autoCad , its now well understood as lines,circles,curves (shapes and only shapes) , i want to identify the street , intersection , square so that i may apply my calculations on it due to entered data on those elements ( street,square,intersection ) .
the problem is turning lines and curves into traffic elements .
i had an idea too , am not going to enter the network from autoCad but i will build my own drawing tool in the program so elements identification is solved in that way .
want your opinions .
thanks alot .
Amr Abbas
|
|
|
|
|
I think you need to look at GIS (Geographical Information System) software rather than AutoCAD. AutoCAD is really not designed to handle geographic information (even although some people insist on using it for the purpose).
I would recommend that you look at products by ESRI, MapInfo, or if you have an especially large project, Smallworld (Now part of GENS - General Electric Network Solutions)
Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
|
|
|
|
|
Hello,
I have looked at the documentations of the NSpring Framework from Jeff Varszegi and the log4net framework. Can anyobdy explain me the differences between these two frameworks?
thx
mathon
|
|
|
|
|
How can I load records column-wise instead of row wise in a datagrid from a database or an object.
|
|
|
|
|
Hi
I want to know how can I write a Grid just like Microsoft winform DataGrid
with DataSource and DataMember support. I want to know how binding and painting occures.
thanks
Farshid
|
|
|
|
|
There are actually several articles here in CP that cover this topic specifically. I would suggest here[^].
- Nick Parker My Blog | My Articles
|
|
|
|