Hi, I would like to implemnet a process that will initial on every form on my application on form InitializeComponent... My thought is to some how customize the Form class and inherite the new class as my Form i.e. "public class Form1 : MyCustomizedForm" But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application. Any ideas? tnx
leeoze 0
Posts
-
how to customize the Form class? -
VSTO outlook stopping fire events while running...?tnx. BTW should I do the same for Application.ItemContextMenuDisplay event? i.e. private this.Application app; .. { app.ItemContextMenuDisplay += new... } ???
-
VSTO outlook stopping fire events while running...?So I have read this and know all of this before... Still no answer to my question. I understand that while the dialog is open the owner is puaused untill I close the dialog. But my problem is after I close the dialog, the addin is still running ok, but all the events I've added from the beggining stopped from firing (i.e. while I change my selection I don't get the event to fire again). Why and how to fix this, I don't know...?! tnx
-
VSTO outlook stopping fire events while running...?Hi I'm writing an outlook addin in VisuaStudio 2008 using the buildin Outlook addin project template of VS2008. In my code I added a new button to one of the ActiveExplorer() commandbars. I made it changed according to the number of items selected in the ActiveExplorer using Application.ActiveExplorer().SelectionChange event. this works just fine up until I click on the button and load my winForm. after doing so it seems like the Application events that I used (including : SelectionChange and ItemContextMenuDisplay) stopped triggered. and the button as a result stopped changing according to the number of items selected. The winform is empty and loads up as ShowDialog. Any ideas why and how to fix it? tnx leeoz here is part of the relevant code (I only missed out the AddMenuBar(), ThisAddIn_Shutdown() and the other events which have the same problem after showing this winForm):
private void InternalStartup()
{
this.Application.ItemContextMenuDisplay +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemContextMenuDisplayEventHandler(Application_ItemContextMenuDisplay);
this.Application.ContextMenuClose +=new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ContextMenuCloseEventHandler(Application_ContextMenuClose);
this.Application.ActiveExplorer().SelectionChange += new Microsoft.Office.Interop.Outlook.ExplorerEvents_10_SelectionChangeEventHandler(ThisAddIn_SelectionChange);
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}void ThisAddIn_SelectionChange()
{
if (btnManualFiling != null)
{
if (this.Application.ActiveExplorer().Selection.Count > 0)
{btnManualFiling.Enabled = true; } else { btnManualFiling.Enabled = false; } CurrentSelection = this.Application.ActiveExplorer().Selection.Count.ToString(); btnManualFiling.Caption = TomaxManCaption + "(" + CurrentSelection + " items)"; } }
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
AddMenuBar();
}private void buttonOne_Click(Office.CommandBarButton ctrl, ref bool cancel)
{ -
how to convert a column in gridview to combobox after binding??DataPropertyName I added a new combobox column during runtime and bound it to the companies table. set the valuemember and displaymember, and defined DataPropertyName to the same column name as the one I need it to be bound to and vwalla... any changes made to the combobox saves it automaticly to the database (need to add an event on cell changes the have the context submit_changes() function)
-
how to convert a column in gridview to combobox after binding??I use linq to sql. I have a table of employees belong to a company by forigen key as companyID on the employees table. (I have compamies table as my main table) the linq does it by it's self and knows that the two are related and after binding the context to the datagridview I get the employees table + column of the company name. my goal is to convert or some how get to the point where I have a coulmn of the employee name and a combobox coulmn of the company which will be bound the companyID. so when I change the company it will know to update the companyID when I submit_changes() on linq context. tnx
-
I'm trying to build a TaskBar similar application, how to enum running applications? (Advanced Q)So far I've managed to do so by EnumDesktopWindows (user32.dll). But I get all windows regardless whether they can displayed on the taskbar. So I'm using isWindow and isWindowVisible but still I don't get the same results as shows on the taskbar. My goal is to create a list of running application that currently showing in the taskbar only. No systray apps!!! My next goal is to get the application Icon and show it (as taskbar does); No idea how to do so. I tried ExtractIcon but did nothing... Any Idea? tnx u all...
-
How to convert Word Doc to Image (jpg/bmp)?Hi, I'm looking for a way to convert a Doc file into an image object with c#. I need this project in order to create an application that will enable the user to give evaluations on paperworks originated by MS Word. My goal is to create a panel that will enable the user to view the doc as an image and paint on it. My thinking was to create two panels, MainPanel and ChildPanel. The ChildPanel will be hosted by the MainPanel. The MainPanel backgroud will be an image of the Word document and the user will be able paint on the ChildPanel. I use Main and Child panels so I can have it as layers, so if the user like to make changes to his evaluations he can do so by erasing/adding changes to the child panel without altering the main document. tnx Leeoz
-
CrystalReports how to Reset Record Number ?use Runing Total! instead of Record Number! In order to reset the number of records you need to add new Runing total. Choose a field of which will be used to count. Select method to Count. Evaluate : each record Reset: Every Group and choose the group header to reset the count. just add the New runing total field to the details section and you are done.
-
CrystalReports how to Reset Record Number ?HI, In my report I have it divided by groups. I added a Recorod Number (Special Field) to Section 3 (Details). For some reason I get a recored count for all recoreds. I would like it to reset back to Zero in every new group. Any Idea? tnx
-
Print the columns of a DataGrid in individual blocksOK, it's actualy very easy thing to do. The main idea is to use the subreports option in the crystalreport item. You need to add a new DataSet item to your project (Add new item -> c# -> DataSet) In this new dataset add new datatable and add rows according to your original table (i.e. Name, Email, and etc.) This DataSet will not be used to host the data, rether this will only be used to set as a Template for your report. You add a CrystalReport item to your project (Add new item -> Reports -> CrystalReport) In the wizard just choose standard and finish the wizard after doing so. Now you should have a blank report with 5 sections. Right click the the white blank area in between "Section 3 (Details)" to "Section 4 (Report Footer)" and choose insert -> subreport. In the dialog the opens up choose "Create a subreport with Report Wizard". Name the report with the title of what you wish to display (i.e. Name) and click on "Report Wizard..." A new dialog name "Standard Report..." should opens up. Expand Project data -> Ado.NET DataSets -> YOURDATASETNAME and by clicking the double arrows to the right of this treeview add your datatable to this report. after doing so click next. now add only the field you wish to display on this table (i.e. Name). Click Next and now you can either finish or click next to the end. Up until now you have created the first section wich will show only the names! In order to show other columns, one under the other, you need to add more sections. Right click the Gray Title named "Section 3 (Details)" and choose insert section below. Now do the same to add subreport with your desired column. keep adding sections for each column you wish to display. In order to display your report you need to do three things. Add a CrystalReportViewer object to a Form. By using the code, Attach your data to the report and the report to the viewer.
//YourDataSet is a DataSet object which should contain all your data from any datasource you have
//You can create and simulate a dataset if you wish just to try the report. try searching online for how to do so.YourCrystalReport objReport = new YourCrystalReport(); //Creating the report object objReport.SetDataSource(YourDataSet); //Binding your data to the report TheCrystalReportViewerObject.ReportSource = objReport;
good luck...
-
Print the columns of a DataGrid in individual blocksI would recommend using CrystalReports. But in order to help you more you need to try and draw us a clearer picture of what is your plan... If you can, post a print screen of your desired final result and we'll see how it goes from there.
-
DataGridViewButton click eventI was searching thru the web and couldn't realy find a conclusive explanation on how to attach an event to DataGridViewButton. Since I found the answer to my question I have decided to share it with others... You can not attach an event to a specific DataGridViewButton. The only way to by pass this block is to use the CellClick event of the DataGridView control. By doing so, keep in mind that this event is automaticly attached to any button on the DataGridView. In order to use this event for a specific button on the row, you will need to check if the object which fired the event has the name of your desired button. Take a look at the example:
if (MyGridView.Rows[e.RowIndex].Cell[e.ColumnIndex].Name == "MyButtonName")
{
//do what ever
}Also, if you notice, when you click on any row on the first cloumn (the blank one that cause a full row selection) it fires the same event. The problem is that it sends a column index of -1 which can not retrive a coulmn name. This cause an expectaion error. In order to fix it use this example:
if (
e.ColumnIndex != -1 &&
MyGridView.Rows[e.RowIndex].Cell[e.ColumnIndex].Name == "MyButtonName")
{
//do what ever
}Make sure the first condition is the "e.ColumnIndex != -1". Hope I could help anyone with this information.
-
Using WMI win32_share in asp.net page not working on IIS6?The problem was on the IIS application pool. in order for me to use Win32_share I need to setup the predefined Identity of the Application Pool to Local System. otherwise I have no premissions to use WMI. I can also set the Configurable to a user with the right premissions to do the same. To access the Identity you need to open the IIS Manager. Colpase the Apllication pools and either create a new pool to be used or edit the deafult by right click and Properties. Go to the Identity tab and choose your wish. Also do not forget to go to under Web Sites and on your selected website/virtual directory properties to set under the Application settings the Apllication pool to the one with the new premissions.
-
Using WMI win32_share in asp.net page not working on IIS6?hi, I'm trying to create a folder sharing using WMI win32_share on an ASP.NET c# page. while running it using the visual studio 2008 it works great. But after I publish it to the IIS and run the WebPage nothing happends?! it's seems like the page was loaded fine but checking the folder I see no share was created. Any ideas? I'm using .NET 3.5, visual studio 2008, c# webapplication. IIS 6 server. here is the code
string shareName = "Test";
string CUDir = @"D:\Test";
ManagementClass managementClass = new ManagementClass("Win32_Share");// Create ManagementBaseObjects for in and out parameters ManagementBaseObject inParams = managementClass.GetMethodParameters("Create"); ManagementBaseObject outParams; // Set the input parameters inParams\["Description"\] = ""; inParams\["Name"\] = shareName; inParams\["Path"\] = CUDir; inParams\["Type"\] = 0x0; // Disk Drive // Invoke the method on the ManagementClass object outParams = managementClass.InvokeMethod("Create", inParams, null);
tnx
modified on Tuesday, January 27, 2009 4:33 AM
-
DataGridViewComboBoxColumn, how the bound dataset into the datagridview.I've created a DataGridViewComboBoxColumn named "cbx". Added 0->"male",1->"female" to it's items; I've added the "cbx" to my GridView as "sexA" column and for each row I "sexA".value = "sex".value; i used this line: gridview.Rows[0].Cells["sexA"].value = gridview.Rows[0].Cells["sex"].value; Just as a remainder, "sex" is int type and also the "cbx" value is int type. thought the results should be to show the displaymember on "sexA" by the value of "sex" it doesn't show anything on "sexA". Although later on I can edit and select a new value to "sexA" but can't do that using code! it's seems like it doesn't update the gridview. I tried GridView.Refresh(). Any ideas? tnx
-
DataGridViewComboBoxColumn, how the bound dataset into the datagridview.Hi, I have dataset that is bound to a DataGridView. In my DataSet I have column "name" (string) and column "sex" (int). So far so good. My problem is: Now I need to convert "sex" to a comboBox type with values 0-> male, 1->female. any ideas? tnx
-
how to retrive the excutions file of a MimeType?Anyhow I found the answer my self already. It's all in the registry. in order to retrive which application is associated with the extention you need to access the OpenWithList key for the extention. all the extentions are located under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts there you can find your extention and all you need is to open the OpenWithList key i.e. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.doc\OpenWithList in this key you will find DWORD's a,b,c each represent and application to use in order to open this file. "a" is the default.
-
how to retrive the excutions file of a MimeType?HI, In My application I need to retrive the excution file for a given mimetype. i.e. I have "Smaple.doc" So I retrive it's MimeType by "doc" extention and now I'm missing the way to retrive the actual excution file of the mimeType (in this example it should be "winword.exe". Any ideas on how to do so? it doesn't have to be the same way I'm thinking of doing it, as long as the in string is a given file name ("xxx.doc") and out is the excution file ("winword.exe"). tnx
modified on Saturday, December 13, 2008 6:19 AM
-
help... backup directory... any idea/class?tnx but my problem is bigger than this. I need to buckup the whole folder including other files that might be in use (xls,spss & etc.) it's a pain. but tnx anyway