|
In VS 2003 there were toolbar buttons for toggling case-sensitive and whole word searches. I often used these in situations where I'd done a keyboard search and then decided I needed to toggle to case-sensitive or whole word. It was easy to use the buttons to do this.
However, these buttons, and the underlying commands, seem to be absent from VS 2005. Anyone know how to do them without having to bring up the Find/Replace dialog?
Kevin
|
|
|
|
|
|
Hi,
I want to create an application with a small backend Database, currently i decide to use an Access DB for now, but what should be the proper way to implement the connection?
I have tried to add an existing access file into the Project, Visual Studio automatically create a DataSet.xsd file for me, what is the use of that file?
Thanks Alot
Hope to find the Answer
From a beginner
|
|
|
|
|
when you are using MS Access Db, Better to use OLEDB Connection. connection string as follows
http://www.sqlstrings.com/MS-Access-connection-strings.htm[^]
DataSet.xsd file is auto generated xml file, will exists client side, .NET Disconnected architecture will follows this xml file.
regards
GV Ramana
|
|
|
|
|
hi to all,
i need to iterate through the documents that are open with winword.
for exp :
suppose we have 5 documents opened with winword. I need to loop through theese 5 documents to see if one of them match the one i search. And if yes, i want to close it (close the document and not winword)
best regards and thanks in advance
fady
|
|
|
|
|
Hi,
Hope this piece of code will help you.
//Add the Microsoft Word 11.0 Object Library Reference
using System.Runtime.InteropServices;
using Microsoft.Office.Interop.Word;
//Fields
private object objSave = false;
private object objOrgFormat;
private object objRouteDoc;
private void IterateWordDocs()
{
//Get the active Word Application
GetWordApplication()
//Iterate docs
foreach (Microsoft.Office.Interop.Word.Document doc in WordApp.Documents)
{
if(doc.Name == "YourDocName")
doc.Close(ref objSave,ref objOrgFormat,ref objRouteDoc);
}
}
public void GetWordApplication()
{
Type typeVisioApp = Type.GetTypeFromProgID("Word.Application");
object objWord = Marshal.GetActiveObject("Word.Application");
this.WordApp = (Microsoft.Office.Interop.Word.Application) Marshal.CreateWrapperOfType (objWord, typeVisioApp);
}
Regards
Gokulan
-- modified at 2:03 Wednesday 28th December, 2005
|
|
|
|
|
I was seeing the UI of Virtools Dev(www.virtools.com). I was wondering how they did it. How did they built it? They used photoshop to make the various components and then import them in Visual Studio? How can you make a custom UI with WinForms but use your own graphics and of course attach functionallity to them?
|
|
|
|
|
Hi,
Nowadays many number of third party image, Photo ediiting softwares are available. Phontoshop is only is for image Editing only. Right?.
many web sites will use flash Script, animation tools etc.
regards
GV Ramana
|
|
|
|
|
Hello can anyone help me with this peculiar problem.
How can i read f.ex text from a textbox belonging to another form(object)
|
|
|
|
|
This article[^] details the techniques that for which you will likely be looking.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
|
|
|
|
|
hi,
you can create a propety and set the property to the textbox's text value when the text is entered and then you can access the data from that property
hope u get it
Regards,
Pramod
|
|
|
|
|
Hope this helps. I think this is the least confusing method. This is the class of the main form that calls the child form:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace PassingDataBetweenForms2
{
public partial class Form1 : Form
{
//Declare an object of Form2 class - the form to be
//called from this form (Form1)
public Form2 ChildForm;
public Form1()
{
InitializeComponent();
}
private void Form1_DoubleClick(object sender, EventArgs e)
{
//Initialize the Form2 class object
ChildForm = new Form2();
//Assign the main form (parent form - of class Form1)
//to the object of class Form1 that is defined in class Form2
//This is the part which creates the link between the two forms
ChildForm.ParentFormObject = this;
//Open/Show the child dialog of class Form2
ChildForm.Show();
}
private void textBox1_Click(object sender, EventArgs e)
{
//When you click in the text box in parent form (Form1 class)
//this assigns a value to a label on the child form (Form2 class)
ChildForm.label1.Text = "This came from the parent form (Form1)";
}
}
}
//*******************************************
//This is the class of the child form
//*******************************************
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace PassingDataBetweenForms2
{
public partial class Form2 : Form
{
//Declare an object of the parent form class (Form1)
//Make sure the controls which neet to be assecced from
//the parent form are public, internal,
//or internal protected otherwise you won't be able to
//access them.
public Form1 ParentFormObject;//Same goes for the Form1, Form2 objects
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//This function is executed when the button on
//this form - child form (of class Form2) is pressed.
//This action assigns a value to the textbox of the parent form (Form1 class)
//from this form - child form (Form2 class)
ParentFormObject.textBox1.Text = "Text sent from ChildForm (Form2)";
}
}
}
-- modified at 12:38 Tuesday 27th December, 2005
|
|
|
|
|
is there a way to deploy a windows service app.. so tht its becomes a sevices at the start up
sathy
|
|
|
|
|
go to
Design view of your Service.cs file, right click add Installer, you will get ServiceInstaller, ServiceProcessInstaller. Select ServiceInstaller, go to properties set StartType to Automatic.
Make a setup project and deploy.
regards
GV Ramana
|
|
|
|
|
thanks GV, but this is how i made the setup but this is installing and i can c my service at the windows service list but i cant start it ... its showing a "JIT error "
sathy
|
|
|
|
|
hi to all,
does any body knows how can i find if a word document is already open with c# win form application
best regards and thanks in advance
fady
|
|
|
|
|
I posted this function before but modified it for your case. Not sure if this will help the finction checks if Microsoft Word program is running and if it is, the function returns true if not, it returns false. You can put this function in a function of a Timer class
//***************************************
//This is just an example of
//executing the function
if (MicrosoftWordIsRunning ()== true)
{
label1.Text = "Microsoft Word is RUNNING!";
}
else label1.Text = "Word is NOT running.";
//*****************************************
that executes the MicrosoftWordIsRunning function at a specified interval - therefore checking every let's say 1000 milliseconds (1 second).
Let me know if you have any questions.
Make sure you include System.Diagnostics:
using System.Diagnostics;//put at the beginning
//put function in class
private bool MicrosoftWordIsRunning()
{
Process[] myProcess = Process.GetProcesses();
int i = 0;
try
{
while (myProcess[i] != null)
{
if (myProcess[i].ProcessName.ToUpper() == "WINWORD")
{
int i2 = 0;
try
{
while (myProcess[i2] != null)
{
myProcess[i2].Close();
i2 += 1;
}
}
catch { }
return true;
}
i += 1;
}
}
catch { }
int i3 = 0;
try
{
while (myProcess[i3] != null)
{
myProcess[i3].Close();
i3 += 1;
}
}
catch { }
return false;
}
-- Don't worry about the world coming to an end today. It's already tomorrow in Australia --
|
|
|
|
|
thanks for your reply,
but i need to iterate through the document that are open.
for exp :
suppose we have 5 document opened with winword. I need to loop through theese 5 documents to see if one of them match the one i search. And if yes, i want to close it (close the document and not winword)
best regards and thanks in advance
fady
|
|
|
|
|
I have a dictionary array with 7 elements: Dictionary<int, string> catDict
and from this array I create linklabels private LinkLabel[] categoriesLinks = new LinkLabel[15]
I do it so:
foreach (KeyValuePair<int, string> kvp in catDict)<br />
{<br />
<br />
this.categoriesLinks[kvp.Key] = new LinkLabel();<br />
this.categoriesLinks[kvp.Key].Location = new System.Drawing.Point(42, 39 + i * 17);<br />
this.categoriesLinks[kvp.Key].Name = kvp.Value;<br />
this.categoriesLinks[kvp.Key].Size = new System.Drawing.Size(115, 13);<br />
this.categoriesLinks[kvp.Key].TabIndex = 1;<br />
this.categoriesLinks[kvp.Key].TabStop = true;<br />
this.categoriesLinks[kvp.Key].Text = kvp.Value;<br />
this.categoriesLinks[kvp.Key].Click += new EventHandler(catClick);<br />
<br />
this.Controls.Add(this.categoriesLinks[kvp.Key]);<br />
i++;<br />
}
And also i have a event for click:
private void catClick(object obj, EventArgs ea)<br />
{<br />
}
How can I in catClick event detect which linkLabel was clicked? Actually I want to know what kvp.Key has this linkLabel.
|
|
|
|
|
you can use the obj to find out the linklabel name. just cast the obj to a linklabel.
<br />
LinkLabel l = (LinkLabel)obj;<br />
MessageBox.Show(l.name);<br />
<br />
|
|
|
|
|
thank you very much. It helped.
|
|
|
|
|
Hi all,
i have created an app which displays a non-rectangular window (i.e the FormBorderStyle is set to none)
I added a button to minimize the window using:
this.WindowState = FormWindowState.Minimized;
This minimizes the window properly to the taskbar (i dont mean the system tray)
When i again click on the window in the task bar, the window pops us and is back as normal. But when i take the mouse over the window it disappears and doesnt come back.
Can anyone tell me where i am going wrong ?????
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
It seems right make sure the form properties in the InitializeComponent() function are all correct. These are mine and they work fine:
private void InitializeComponent()
{
//Code for Button, etc. initialization here
//
// Form1
//
this.AcceptButton = this.button1;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(433, 260);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.KeyPreview = true;
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
// Here is the code in the form class
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
}
//Let me know if it doesn't work still
|
|
|
|
|
Hi Peshkunta,
Thanks for the reply.
I tried adding your code to mine..
But the problem is that there are no properties of the form named as either AutoScaleDimensions or AutoScaleMode:
....<br />
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);<br />
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;<br />
....
I searched the MSDN too, but no such property is listed there. At the most, i was able to find AutoScaleBaseSize and ClientSize.
Here's my code. Can you please see, if there is anything which i need to add.
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
this.textBox1.BackColor = System.Drawing.Color.White;
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.ForeColor = System.Drawing.Color.Black;
this.textBox1.Location = new System.Drawing.Point(16, 168);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(269, 16);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "";
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(102)), ((System.Byte)(102)), ((System.Byte)(153)));
this.richTextBox1.Location = new System.Drawing.Point(16, 32);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedHorizontal;
this.richTextBox1.Size = new System.Drawing.Size(269, 128);
this.richTextBox1.TabIndex = 2;
this.richTextBox1.Text = "";
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(433, 260);
this.BackColor = System.Drawing.Color.Lime;
this.ClientSize = new System.Drawing.Size(312, 208);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.Text = "Form1";
this.TransparencyKey = System.Drawing.Color.Lime;
this.KeyPreview = true;
this.Resize += new System.EventHandler(this.Form1_Resize);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.Load += new System.EventHandler(this.Form1_Load);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
this.ResumeLayout(false);
}
Please see, if i am missing anything !!!!
Thanks.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
I think the problem is in the event handler functions Form1_Resize, and the others:
this.Resize += new System.EventHandler(this.Form1_Resize);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.Load += new System.EventHandler(this.Form1_Load);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
If you can, I would like to see the code in those. I was wondering what method/way you use to minimize the form/dialog since your dialog has no border. Are you using a button, or just a hit-test location on the form to click? If you want to have your own custom minimize button, one easy way to do it is to create a normal button and set it to Flat style, with no text and your image in the button that can change when you press for button being pressed, etc. Make sure the Flat button BorderSize is set to 0 otherwise there will be a border there. And make sure the MouseDownBackColor and MouseOverBackColor are set to Transperent.
-- modified at 1:05 Wednesday 28th December, 2005
|
|
|
|