.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

how to remove system-based border on the active "accept" button on WinForm

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :Windows Application

I have created a custom button and placed it on to a win form. The button has an image and I remove all border. Here is the snippet of the custom button class...

this.FlatAppearance.BorderColor = SystemColor.Control;

this.FlatAppearance.BorderSize = 0

this.FlatStyle = FlatStyle.Flat

This code line remove any border and make button look like an image button when it got focus or clicked.

Now the problem is when I set the win form AcceptButton property and assign this button name to this property to make this button as default button (when press enter from keyboard will execute the button eventhandler), I could see a border around the button control. Is there any way/property/override to remove this feature or any other workaround?

Quick response would be highly appreciated.




View Complete Post

More Related Resource Links

Code Name WinFS: Revolutionary File Storage System Lets Users Search and Manage Files Based on Conte


One of the monumental problems organizations face today is aggregating information that's stored in disparate formats. Knowledge workers have long wanted to be able to search for content independent of format. The next version of the Windows operating system, code-named "Longhorn," boasts a new storage subsystem that makes that task easier. That subsystem, code-named "WinFS," allows the user to perform searches based on the metadata of the stored item, regardless of what type of file it is or which application created it. This article covers the basic architecture of WinFS and explains how to use the WinFS managed API.

Richard Grimes

MSDN Magazine January 2004

Creating a "Save Button" in a browser based Form

I'm not sure if I'm missing something obvious, but I need to have the funtionality of the "Save Button", which is available and works on the tool bar, available in the form...and I can't seem figure out how to do it.I've found examples, in this forum, of how to use the "Submit Button" to act as the "Save Button", which did work for me, but only when specific basic criteria was met.The criteria that I now have is that I'm initiating a workflow to automatically start when a new item is created.  My workflow then moves the form to one of a few possible different form libraries, based on the logic in my workflow.  The different form libraries are to manage different teams of people that would have access to the Form and then that team would process the form accordingly.My specific situation: 1 - User opens a new form (works) 2 - User enters data and then submits the new form (works) 3 - Workflow is initiated and the form is moved to another form library to be worked on by a select group of people (works) 4 - The form is opened and reviewed and some changes are made to the form data by the select group of people (works) 5 - The form data in the form libary is updated (works, but only if the save button is pressed in the tool bar and then manually closes t

Control this objectdatasource programatically from the code behind based on different button clicks

I have a page where you can search and display other data, very simple layout. 1 Gridview and 1 objectdatasource. But i have 4 possible buttons that can populate the gridview.. i would like to control my objectdatasource from the code behind based on the button you click. here is what i have right now.. but if possible, can this source not be hardcoded like this and only built in the code behind? <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectDVRInfo" TypeName="DataAccessCode"> <SelectParameters> <asp:ControlParameter ControlID="ddlDVR" Name="dvrInfo" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:ObjectDataSource> I found this site with a solution to this persons issue, but i cant seem to get mine working this way. http://stackoverflow.com/questions/2404264/overwriting-controlparameters-of-datasources-in-code-behind I have  this as the code behind right now when you press the button.. what other parameter settings am i missing and is this the right order to populate them for the source to acknowledge my values?   ObjectDataSource1.SelectMethod = "SelectDVRInfo"; ObjectDataSource1.SelectParameters["MyParameter"]

How can you remove the Save button on a survey?

What options are there to remove the SAVE button from a SharePoint survey?I need to remove this if possible, I was hoping it would be as simple as editing a form in the Survey list... but that is apparently not the case.I need to supress the SAVE button as it confuses end users and we don't want any half completed surveys. Either it gets finished or not at all.Can someone hopefully provide me with an nice simple solution?  Or any solution at all :)Thanks!

Enable a button based on a list via code behind


I've got a ListView with textboxes inside (bound to a property) and a button behind it.

I'd like to make the button enabled only when:

1) Each TextBox is not empty (each property has got a value)

2) Each TextBox has not got errors

How can I do it via code behind?


Is there a way to undo/remove/delete an active directory user profile syncronization? [SP 2010]


I successfully managed to synchronize the active directory with Sharepoint 2010.  Unfortunately, the farm I was on has different FQDN /Netbios domain names.  So all ~1000 user profiles are now imported with the wrong domain, and the subsequent errors one would expect.


Is there a way to get back to a blank slate?  technet has an article on "resetting" profile synchronization (http://technet.microsoft.com/en-us/library/ff681014.aspx), but that requires being able to verify the GUID of the user profile synchronization database, which I am also unaware of how to do.


Please help, and thank you in advance.

how do I change BORDER COLOR for a TEXTBOX (and any other winform control) in a windforms app in VB

Does anyone have the VB code to change  border colors for winform controls such as a textbox?

Hide edit button on editform based on whether the user is item's creator


Hi Everyone


I would like to hide/show the edit button on a list item's edit form based on whether the user is the item's creator.  The reason I want to do this is because SharePoint's out-of-the-box behaviour is such that when a user edits someone else's item, the Access Denied page pops up AFTER the user makes his/her edits and presses ok.


My users want the edit button to be hidden so they don't have to go through the steps of making the edits, press ok, and then find out their access is denied.


I have done some research, and the approach I have arrived at is to create my own edit item user control, which has my own cutom code which checks if the user is the creator, and then hide/show the edit button.  I have 2 questions surrounding this:


1) Can anyone provide some advice or resources on the web which describes how to best implement an edit form user control and then integrate it into SharePoint so that the user control is only used on my particular list, and doesn't affect anything else in the site collection.


2) Can anyone suggest another approach perhaps requires less custom development effort than the custom user control approach?

Help creating an Add/Remove button for data entry

I have a form that is currently made up of 4 items:  DateTime Picker, Origin TextBox, Destination TextBox, and a read only Mileage TextBox. Each row represents one entry. I have two buttons next to each entry for Adding and Removing entry lines.  How would I go about coding those buttons to do just that?

enable a button control on an InfoPath form based on another button control



is it possible to enable a button control based on another button control. so when a user click on a button it enable another button. only if the first button is clicked the second button can be click aswell


Blue Border on first web page button


On every web page I build, the first asp:button always has a blue border at runtime, even if I set another button as the default button. How do I make the default button have the blue border without making it the first button on the page, or get rid of the blue border on the first button? 

Do I remove the reference System.Web.Extensions when upgrading from VS 2005 to VS 2008?


I've got an old ASP.NET 2.0 app, which I added the AJAX Toolkit to, later in development.  When I did that I had to include the System.Web.Extensions.dll in the bin folder of the ASP.NET app, in order for it to work.  Naturally I then included a reference to that assembly DLL into the project, and pointed to it for each page I used it in.

Now I want to upgrade the app to VS 2008.  When I did it looks to me as though it added another reference to System.Web.Extensions from the GAC.  Now VS 2008 is confused and wants me to remove one of them.  The question is, which one do I remove? 

Need to remove the border from gridview header


I have created a custom gridview that show "Select All | Clear All" hyper links in header to select the checkboxes in the gridview. That means that I have added these two hyperlink controls to the gridview header and am not showing the actual column headers.

        private void CreateMyHeader()
            GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);
            TableCell th = new TableHeaderCell();

            th.HorizontalAlign = HorizontalAlign.Left;
            th.ColumnSpan = this.Columns.Count+1;
            th.Font.Bold = false;
            th.BorderStyle = BorderStyle.None; //Not working

            HyperLink hlCtl1 = new HyperLink();
            hlCtl1.ID = "{0}_HeaderLink1";
            hlCtl1.NavigateUrl = "javascript: SelectAll(true)";
            hlCtl1.Text = this.HeaderSelectAllLinkText;

            Label lblSeparator = new Label();
            lblSeparator.Text = this.HeaderLinkSeparator;

            HyperLink hlCtl2 = new HyperLink();
            hlCtl2.ID = "{0}_HeaderLink2";
            hlCtl2.NavigateUrl = "javascript: SelectAll(false)";
            hlCtl2.Text = this.HeaderClearAllLinkText;

Active Service Requests based on start and end date, where date is null or in range



I have FACT and DATE dimension

ServiceRequestFactID          StartDateId           EndDateId

100              20090401              20090501
101              20090501              NULL
102              20100301              20090401

       DateID              FYear     FQuarter     FPeriod
       20080401          2009        Q1            01
       20080429          2009        Q1            02


Some service requests do not have end date, which means that they have service request all the time.

Date Hierarchy:   FYear -> FQuarter -> FPeriod. (Note: the hierarchy is not till the date level)


MDX Help: How to calculate the acti

How To: Filter a link list dropdown field in a form based on Active/Inactive field in the linked li


I need to filter a dropdown field on a form that is linked to another list.  The linked list has a field active/inactive and I only want the active ones to show on the form.

Remove the Modal Dialog 'Page' Button


Hello ...

Throughout my SP 2010 / InfoPath2010 site, I have a number of Modal Dialogs that were developed with InfoPath2010.  Everything is working fine apart from one nagging problem ... each Modal Dialog appears with the 'PAGE' button at the top.  Clicking it opens up the toolbar with various options available. 

How do I get rid of this?  Or is it only appearing because I've got admin access?




Active Directory bulk data update error System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIf



we are trying to update bulk data into Active Directory from some database table. If we run for say 40000 users, it fails in between While updating its failing with an exception that. The server is not operational.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_AdsObject()
   at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
   at System.DirectoryServices.DirectorySearcher.FindOne()

Below is the piece of code updating the records ...


While drDataReader.Read()
                strMailID = drDataReader.Item(("EMAILID")).ToString()
                strAttributeName = drDataReader.Item("ATTRIBUTENAME").ToString().Trim()
                strAttributeValue = drDataReader.Item("ATTRIBUTEVALUE").ToString().Trim()

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend