|
I have to support windows 98 since that's the OS the clients will be running on. It would be better to say: Use windows XP or else you are soooo screwed. But yeah, customers ...
Anyway, the solution works perfectly
So thanks for the help.
WM.
What about weapons of mass-construction?
|
|
|
|
|
I am looking to allow the user to move a control on the screen by clicking and dragging a control and then releasing the mouse. Much like a desktop shortcut. My control will be a usercontrol and I am unsure of how to understand how to interpret the mouse poisition on screen and on the control along with the mouse event listeners to successfully move the control fluidly around the screen.
Thanks
M4tt
|
|
|
|
|
|
hi all,
i want to create a bar like the horizontal left one that separates the buttons from the rest of the things in the leftmost part in outlook 2003.is it a splitter bar or nething else.normal splitter bar uses shadows while moving but this one doesn't.
thanx in advance..
|
|
|
|
|
This site contains many articles about all sorts of controls. All you need to do is search[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
i was searching for the particular thing for the last few days but unfortunately i haven't found any solution to my query yet.yes you r quite
right to say that this site contains many articles about controls.but my problem is that i'm not sure of the control that is used to create that bar(the bar that separates the buttons panel and the shared calendar in the leftmost part of the application).first i thought it was a splitter bar, but then splitter bar leaves an shadow(or an impression of itself) while moving while the bar that i mentioned in outlook 2003 doesn't.if i am wrong at ne point do correct me.
just.starting..
|
|
|
|
|
When you say "Outlook splitter" how am I supposed to know that you mean the splitter that is implemented by Windows. It's not specific to Outlook, though Outlook's implementation of the splitter draws while resizing. The default does not.
To use the splitter, you dock a control to one side, then dock the splitter to the same side, then dock another control to all sides (fill). It must be done in that order or you'll have to change the generated code manually to fix it. It will draw a frame as you move it then resize the docked controls after you release the mouse. Outlook works the same way because it uses the same splitter (the splitter is actually a native Windows Common Control that Windows Forms encapsulates).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
In Visula Studio Help....Search for "Multipane User Interface"...There is a very nice article entitled "Walkthrough: Creating a Multipane User Interface with Windows Forms".....this seems like what you are after.
Cheers
Craig
|
|
|
|
|
hi all,
does anyone knows where i can find a TextBox that is specialized in inputing the IP address in its format, i saw may controls for that purpose so i guess there are already ones that are created and i don't want to recreate them again.
thanks in advance.
Hercules
|
|
|
|
|
You can use the normal textbox but with validation. FYI, I think .NET 2.0 has a masked textbox with validation built in.
Any remotely useful information on my blog will be removed immediately. There are 10 kinds of people in the world. Those who have heard of the ubiquitous, overused, worn-out-like-an-old-shoe binary "joke" and those who haven't.
Judah Himango
|
|
|
|
|
I have a opend NetworkStream for Read. If I do Read(buffer, 0, 3) in buffer I have byte[] {49, 13, 10}. But if I create StreamReader to read from NetworkStream function ReadLine awlays return null. All examples that I look at using ReadLine from StreamReader. What can I do? Is it posible because my NetworkStream is opend from Socket not from TcpClient.GetStream()?
And one more question: Because my socket will be opend permanently, how can I implement waiting until data was recieved, using the model above?
|
|
|
|
|
It doesn't matter where the stream comes from, as long as it represents text if you're using a TextReader derivative like StreamReader .
What encoding did you specify? A NetworkStream is a stream of bytes - not characters - and bytes are encoded specificy for different text representations like 7-bit ASCII or 8-bit ASCII with a codepage (ANSI) for a specific system. There's also UTF8 and Unicode, where Unicode is 2 or 4 bytes per character. .NET stores and treats characters internally as UCS-2 (2-byte Unicode).
Also keep in mind that when you read from a stream the cursor (stream position) is advanced so you cannot read that data again from a non-seekable stream (like a NetworkStream , since bytes are being transferred across the net). If you need a non-seekable stream to be seekable you need to cache the data and read-in the cached data, using that to read and seek in the stream.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I want how to fire shortcut keys programatically. How can I make an action for some button event to fire any keyboard shortcut. Let me give you an example:
Suppose we have some button with caption "Button1" that button has a function for his click event called "button1_click", that function should contain the code that I asking for. That code should fire the required keyboard shortcut like (CTRL+C, CTRL+V, CTRL+S,...).
So, if any can help please send me. Summary for what I need is to fire shortcut keys though code programming.
Another point. How can I get the selected text in an opened browser (InternetExplorer) programatically from another application?
Thank You
egyseiko
|
|
|
|
|
For first question you can use:
System.Windows.Forms.SendKeys.Send("^C");
System.Windows.Forms.SendKeys.Send("^V");
System.Windows.Forms.SendKeys.Send("^S");
|
|
|
|
|
I executed that comman for CTRL+C "System.Windows.Forms.SendKeys.Send("^C");" to make copy while I'm selecting some textbox text as for test. Then make paste using CTRL+V but it didn't give me the result for the textbox text. Is that means it didn't fire CTRL+C using "System.Windows.Forms.SendKeys.Send("^C");"
egyseiko
|
|
|
|
|
This code works for me:
copytextbox.Focus();
SendKeys.SendWait("^c");
pastetextbox.Focus();
SendKeys.SendWait("^v");
So , use SendWait() instead of Send() and focus on the control you want before sending shortcut keys.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
is it possible to give relative XML file path so that when a setup is installed on other machines,it fetches XML itself?
private string m_strFileName = "account.xml";
it`s giving error
thanks
|
|
|
|
|
Relative to what? When using the IO classes files are already relative to the application's - not the library in which your code runs - current working directory, not necessary the application's installation directory. You can get the current working directory by getting Environment.CurrentDirectory and the application's installation directory by getting Application.ExecutablePath , passing that to Directory.GetParent .
Depending on what installation technology you're using you can also get the exact path to any file regardless of what type it is. Since you didn't provide any details about what you're trying to do, however, it's impossible to help you.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi! Try this:
private string m_strFileName = ".\\account.xml";
----------------------
Seeing the infinite...
|
|
|
|
|
I have a problem with this code:
------------------------------------------------------------
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct StructA
{
public int MyVariable;
}
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct StructB
{
[System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 3)]
public StructA[] MyArray; // size must be 3;
}
------------------------------------------------------------
If I take Marshal.SizeOf(StructB) I have this error: Type can not be marshaled as an unmanaged structure; no meaningful size or offset can be computed. So, what can I do to fix the problem?
|
|
|
|
|
There are limitations to marshaling C-style structs in managed code. See Interop Marshaling[^] for details.
You can unroll your structure (or "flatten" it) to make a new structure. This is typically preferred over marshaling structs within structs (which is not supported at all on .NET CF).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Heyas all,
I'm kind of confused on this myself, so I'll attempt to explain the best I can, so bare with me
I'm making a cataloging program that reads data from an xml file. The xml file has to obvisiously have a specific format, or at least specific tags to look for to load the correct data into the controls on the windows form. I'm thinking that XmlDocument is the best way to go so I have
<br />
public class XmlData<br />
{<br />
public int CheckForData(string filename)<br />
{<br />
if(!File.Exists(filename))<br />
{<br />
XmlDocument Xdoc = new XmlDocument(nameTable);<br />
}<br />
}<br />
}<br />
This brings up more issues. First and foremost, how do I go about using a NameTable? The user needs to be able to name their file anything, so how do I go about ensuring that the last file used is loaded the next time the program starts, and also, if a file hasn't been previously used, that a new default file is loaded. I've created and added a skeleton xml file that I want the program to use to the project called BlahData.xml. Am I on the right track in anything I'm doing or thinking?
ANY INFORMATION even remotely related to what I'm attempting to accomplish will be most appreciated.
Thanks all,
John
|
|
|
|
|
Hi,
Ill try to break up your requests to little answerable parts :
1. I see no need for you to specify a NameTable for your XmlDocument. Just use the parameterless constructor, when working with XmlDocument.
2. To load the last file used in the next session you will have to store this information somewhere. As I think this wont be the last setting you need to store in your program I would create a configuration file in xml format where you can store any type of information. You could search CodeProject for this part. If I remember right there is at least one implementation around which should make this point easy.
3. To create a skeleton of your xml was no bad idea. Depending on the complexity of its structure you could also create it programmatically, but having a template makes it simpler. You can add the file directly to your assembly as an embedded resource and save it to your desired location with the following code:
<br />
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();<br />
<br />
Stream inputStream = assembly.GetManifestResourceStream("DefaultNameSpaceOfTheProject.FileNameOfTheEmbeddedResource");<br />
FileStream outputStream = new FileStream(newFilePath, FileMode.CreateNew);<br />
byte[] buffer = new byte[1024];<br />
while (true) <br />
{<br />
int read = inputStream.Read(buffer, 0, buffer.Length); <br />
outputStream.Write(buffer, 0, read);<br />
if (read < 1024)<br />
break;<br />
}<br />
outputStream.Close();<br />
inputStream.Close();<br />
This will assure that noone changes your default file once the program is installed.
|
|
|
|
|
Is there a tool that can convert rtf to html? The setup is this, the rtf text will be coming from the DB. The conversion will happen on the server, so i don't have access to the file system; so Word SaveAsHTML won't work.
OK, does someone know of anything?
|
|
|
|
|
A quick search[^] on "rtf to html" yields many, many results and this has been covered many times on this site. Click "Search comments" at the top of this message board to search for additional comments.
Actually you can use Word because Word does not have to load from a persistent file, but can also load from a stream. This is because the Word.Document object implements IPersistStorage (a COM interface) which loads an IStorage object, which you can obtain from P/Invoking OleCreateFromData . This requires interop'ing many native interfaces, like those I mentioned above as well as IDataObject (which is different from .NET's implementation of IDataObject , though they represent the same thing). A good understand of Interoperating with Unmanaged Code[^] is required, and knowledge of COM is very helpful.
This is still not the greatest idea, however, since the Word automation server is not scalable and should typically not be used on the backend of a client/server application.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|