Search Results

Search found 23674 results on 947 pages for 'custom action'.

Page 11/947 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Winforms fixed single border on custom shaped control

    - by JD
    Hi all, I have created a custom control inheriting from a panel in .NET 3.5 The panel has a custom polygon border, which comes from a pointF array (In diagram, control is highlighted yellow). Fig 1 shows the control with BorderStyle none. Fig 2 with BorderStyle fixed-single As shown in Fig 2, the border follows the Rectangle bounding the control. IS there a way to make the border follow the actual border of the control set by the polygon? FYI the polygon is created using a GraphicsPath object. Drawing the line with GDI+ does not work, as the control clips the line and it looks awful... Fig1 Fig2

    Read the article

  • linq Except and custom IEqualityComparer

    - by Joe
    I'm trying to implement a custom comparer on two lists of strings and use the .Except() linq method to get those that aren't one one of the lists. The reason I'm doing a custom comparer is because I need to do a "fuzzy" compare, i.e. one string on one list could be embedded inside a string on the other list. I've made the following comparer ` public class ItemFuzzyMatchComparer : IEqualityComparer { bool IEqualityComparer<string>.Equals(string x, string y) { return (x.Contains(y) || y.Contains(x)); } int IEqualityComparer<string>.GetHashCode(string obj) { if (Object.ReferenceEquals(obj, null)) return 0; return obj.GetHashCode(); } } ` When I debug, the only breakpoint that hits is in the GetHashCode() method. The Equals() never gets touched. Any ideas?

    Read the article

  • Android: custom view onClickEvent with X & Y locations

    - by Martyn
    Hi, I've got a custom view and I want to get the X and Y coordinates of a user click. I've found that I can only get the coordinates from the onTouchEvent and an onClickEvent won't fire if I have an onTouchEvent. Unfortunately the onTouchEventfires when the user drags the screen as well as clicking. I've tried to differentiate between the two, but I still get the code firing when I'm dragging: public boolean onTouchEvent(MotionEvent event) { int action = event.getAction(); if (action == MotionEvent.ACTION_DOWN) { //fires on drag and click I've had a look at this but as I mentioned above I don't think the solution there will work as I can't get the onClick and the onTouch events working at the same time. Maybe I'm doing something wrong in this respect, is there a normal way of dealing with capturing user input on custom events? Should I be able to use the onClick and onTouch events at the same time? Thanks, Martyn

    Read the article

  • Custom realm/starting Tomcat 6.0 from Netbeans 6.8/first HTTP request

    - by Drew
    I'm using NetBeans 6.8 and Tomcat 6.0.xx. I've created a custom realm and updated the NetBeans project build.xml to deploy the realm to Tomcat. When I debug the project, NetBeans starts the Tomcat server and makes an initial HTTP GET request for 'manager/list'. Tomcat graciously hands this request off to my custom realm for authentication. The request gets denied and NetBeans displays the following error in the output window: (note: error is displayed after NetBeans gets access denied) Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager. Do I have something incorrectly configured? How do I prevent NetBeans from issuing this initial request? Thanks, Drew

    Read the article

  • GWT Custom Events

    - by Ciarán
    Hey I have a problem getting my head around how custom GWT event Handlers work. I have read quite a bit about the topic and it still is some what foggy. I have read threads here on Stackoverflow like this one http://stackoverflow.com/questions/998621/gwt-custom-event-handler.Could someone explain it in an applied mannar such as the following. I have 2 classes a block and a man class. When the man collides with the block the man fires an event ( onCollision() ) and then the block class listens for that event. Thanks

    Read the article

  • Subcontrols not visible in custom control derived from another control

    - by Gacek
    I'm trying to create a custom control by deriving from a ZedGraphControl I need to add a ProgressBar to the control, but I encountered some problems. When I create a custom control and add both, ZedGraphCOntrol and ProgressBar to it, everything is OK: MyCustomControl { ZedGraphControl ProgressBar } All elemnets are visible and working as expected. But I need to derive from ZGC and when I add a progress bar as a subcontrol of ZedGraphControl: MyCustomControl : ZedGRaphControl { ProgressBar } The progress bar is not visible. Is there any way to force the visibility of ProgressBar? Is it possible, that ZedGraphControl is not displaying its subcontrols? I tried do the same thing with a simple button and it's also not being displayed.

    Read the article

  • Custom fine-grained claims based authorization system in ASP.NET MVC - wheres and hows

    - by BuzzBubba
    So, I'd like to implement my own custom authorization system in MVC2. If I'd have to create a global class, where do I instantiate it? Can HttpContext be extended with my own additions and where do I do that? Should I use Authorization filters for rights validation or ActionFilters or do it within an action? Can ActionFilter pass any data to the action itself? Previously (in WebForms) I was using a Session object where I would put a serialized object containing essential user data (account id and a list of roles and rights) and I'd extend my own Page class.

    Read the article

  • ELMAH - Using custom error pages to collecting user feedback

    - by vdh_ant
    Hey guys I'm looking at using ELMAH for the first time but have a requirement that needs to be met that I'm not sure how to go about achieving... Basically, I am going to configure ELMAH to work under asp.net MVC and get it to log errors to the database when they occur. On top of this I be using customErrors to direct the user to a friendly message page when an error occurs. Fairly standard stuff... The requirement is that on this custom error page I have a form which enables to user to provide extra information if they wish. Now the problem arises due to the fact that at this point the error is already logged and I need to associate the loged error with the users feedback. Normally, if I was using my own custom implementation, after I log the error I would pass through the ID of the error to the custom error page so that an association can be made. But because of the way that ELMAH works, I don't think the same is quite possible. Hence I was wondering how people thought that one might go about doing this.... Cheers UPDATE: My solution to the problem is as follows: public class UserCurrentConextUsingWebContext : IUserCurrentConext { private const string _StoredExceptionName = "System.StoredException."; private const string _StoredExceptionIdName = "System.StoredExceptionId."; public virtual string UniqueAddress { get { return HttpContext.Current.Request.UserHostAddress; } } public Exception StoredException { get { return HttpContext.Current.Application[_StoredExceptionName + this.UniqueAddress] as Exception; } set { HttpContext.Current.Application[_StoredExceptionName + this.UniqueAddress] = value; } } public string StoredExceptionId { get { return HttpContext.Current.Application[_StoredExceptionIdName + this.UniqueAddress] as string; } set { HttpContext.Current.Application[_StoredExceptionIdName + this.UniqueAddress] = value; } } } Then when the error occurs, I have something like this in my Global.asax: public void ErrorLog_Logged(object sender, ErrorLoggedEventArgs args) { var item = new UserCurrentConextUsingWebContext(); item.StoredException = args.Entry.Error.Exception; item.StoredExceptionId = args.Entry.Id; } Then where ever you are later you can pull out the details by var item = new UserCurrentConextUsingWebContext(); var error = item.StoredException; var errorId = item.StoredExceptionId; item.StoredException = null; item.StoredExceptionId = null; Note this isn't 100% perfect as its possible for the same IP to have multiple requests to have errors at the same time. But the likely hood of that happening is remote. And this solution is independent of the session, which in our case is important, also some errors can cause sessions to be terminated, etc. Hence why this approach has worked nicely for us.

    Read the article

  • ASP.NET MVC Custom Error Pages with Magical Unicorn

    - by FLClover
    my question is regarding Pure.Kromes answer to this post. I tried implementing my pages' custom error messages using his method, yet there are some problems I can't quite explain. a) When I provoke a 404 Error by entering in invalid URL such as localhost:3001/NonexistantPage, it defaults to the ServerError() Action of my error controller even though it should go to NotFound(). Here is my ErrorController: public class ErrorController : Controller { public ActionResult NotFound() { Response.TrySkipIisCustomErrors = true; Response.StatusCode = (int)HttpStatusCode.NotFound; var viewModel = new ErrorViewModel() { ServerException = Server.GetLastError(), HTTPStatusCode = Response.StatusCode }; return View(viewModel); } public ActionResult ServerError() { Response.TrySkipIisCustomErrors = true; Response.StatusCode = (int)HttpStatusCode.InternalServerError; var viewModel = new ErrorViewModel() { ServerException = Server.GetLastError(), HTTPStatusCode = Response.StatusCode }; return View(viewModel); } } My error routes in Global.asax.cs: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" }); routes.MapRoute( name: "Error - 404", url: "NotFound", defaults: new { controller = "Error", action = "NotFound" } ); routes.MapRoute( name: "Error - 500", url: "ServerError", defaults: new { controller = "Error", action = "ServerError" } ); And my web.config settings: <system.web> <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="/ServerError"> <error statusCode="404" redirect="/NotFound" /> </customErrors> ... </system.web> <system.webServer> <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" path="/NotFound" responseMode="ExecuteURL" /> <remove statusCode="500" subStatusCode="-1" /> <error statusCode="500" path="/ServerError" responseMode="ExecuteURL" /> </httpErrors> ... The Error views are located in /Views/Error/ as NotFound.cshtml and ServerError.cshtml. b) One funny thing is, When a server error occurs, it does in fact display the Server Error view I defined, however it also outputs a default error message as well saying that the Error page could not be found. Here's how it looks like: Do you have any advice how I could fix these two problems? I really like Pure.Kromes approach to implementing these error messages, but if there are better ways of achieving this don't hestitate to tell me. Thanks! *EDIT : * I can directly navigate to my views through the ErrorController by accessing /Error/NotFound or Error/ServerError. The views themselves only contain some text, no markup or anything. As I said, it actually works in some way, just not the way I intended it to work. There seems to be an issue with the redirect in the web.config, but I haven't been able to figure it out.

    Read the article

  • custom validation does not seem to get registered.

    - by viet pham
    Hi, Inside a tab, I have a form that is dynamically loaded via ajax. Since the name of the field is dynamic too (e.g. ), I write a custom validation method inside the "on complete" like this. However, the custom code does not get executed (bolded alert never pops up) no matter what i try. $.ajax ( { url: 'index.php?func=trainingmgr&aAction=displayAddForm', type: 'GET', dataType: 'html', complete: function(req, err) { //Append response to the tab's body $(href, '#trainingTabs').append(req.responseText); $.validator.addMethod ( 'tRequired', function(value, element) { if(value == '') { **alert('I am empty');** return true; } else return false; }, '<br>Required field' ); $('#upload' + index).click ( function() { $('#addForm' + index).validate().numberOfInvalids(); } ); } } );

    Read the article

  • C# Processing Enter Key on Custom Container

    - by tycobb
    I am currently building a custom container control. Everything was going along smoothly until I hit a snag during testing. I noticed that the Enter key is not getting processed to the control that has focus inside the container. Everything else works as expected though. I am able to click the button with either the mouse or space bar, but enter does not want to get processed. After doing endless searches on container controls and processing the enter key I have come up with no solution. I tried returning Enter as true in IsInputKey(Keys keyData) and that didn't work. Neither did setting KeyPreview on the form. I have tried it with my custom button and .NET's standard button. Like I mentioned earlier, spacebar will trigger the desired effect. Please tell me what I am missing. There has to be an easy / stupid simple way to get Enter to process over to the active child control.

    Read the article

  • Cannot access implict object from within method in custom JSP tag file

    - by David Hamilton
    I'm attempting to create a custom jsp tag. Everything is working fine, except for the fact that I the request seems to be out-of-scope for my custom function. Here is the relevant bit from the .tag file: <%! private String process(String age, BigDecimal amount) { //Attempting to access request here results in an compile time error trying to: String url=request.getURL; } %> I'm very new to JSP so I'm sure I'm missing something obvious..but I can't seem to figure out what. Any help is appreciated.

    Read the article

  • LinearLayout as custom button, OnClickListener never called

    - by ohra
    I've been using the common Android Button with both icon (drawableTop) and text. It works really poorly if you want to have a non-standard size button, so I decided to make a custom button with a LinearLayout having the following layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/ButtonHoloDark" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:clickable="true" android:focusable="true" android:orientation="vertical" > <ImageView android:id="@+id/buttonIcon" android:layout_width="fill_parent" android:layout_height="wrap_content" android:duplicateParentState="true" /> <TextView android:id="@+id/buttonText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:duplicateParentState="true" android:gravity="center" android:textColor="@color/white" /> </LinearLayout> The layout is used by a custom class: public class CustomIconButton extends LinearLayout { public CustomIconButton(Context context, AttributeSet attrs) { super(context, attrs); setAttributes(context, attrs); LayoutInflater.from(context).inflate(R.layout.custom_icon_button, this, true); } ... But when I set an OnClickListener on my button in its parent layout it never gets called. I can only receive clicks if a set the listener to the ImageView and/or TextView. This leads to two possible effects when the button is clicked: The click is inside the ImageView or the TextView. The click is registered ok, but the buttons state drawable doesn't change i.e. it doesn't appear depressed. The click is inside the "empty area" of the button. The click is not registered, but the state drawable works ok. Neither of these is feasible. I've played around with the following attributes on the LinearLayout or its children, but none really seem to have any effect whether true or false: duplicateParentState clickable focusable There doesn't seem to be any reasonable way to get the LinearLayout parent receive clicks instead of its children. I've seen some possible solutions overriding dispatchTouchEvent or onInterceptTouchEvent on the custom component itself, but that really seems like a big mess if I have to start analyzing touch events to identify proper clicks. So OnClickListener on a LinearLayout with children = no go?

    Read the article

  • custom control in DataGridTemplateColumn

    - by Johnsonlu
    Hi all, I'd like to add my custom control into a template column of data grid. The custom control is very similar to a text box, but has an icon in it. The user can click the icon, and selects an item from a prompted window, then the selected item will be filled into the text box. My problem is when the text box is filled, after I click the second column, the text will disappear. If I replace the custom control with a simple text box, the result is the same. Here is the sample code: //Employee.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SimpleGridTest { public class Employee { public string Department { get; set; } public int ID { get; set; } public string Name { get; set; } } } Mainwindow.xaml <Window x:Class="SimpleGridTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <DataGrid x:Name="grid" Grid.Row="1" Margin="5" AutoGenerateColumns="False" RowHeight="25" RowHeaderWidth="10" ItemsSource="{Binding}" CanUserAddRows="True" CanUserSortColumns="False"> <DataGrid.Columns> <DataGridTemplateColumn Header="Department" Width="150"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text="{Binding Department}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTextColumn Header="ID" Binding="{Binding Path=ID}" Width="100"/> <DataGridTextColumn Header="Name" Binding="{Binding Path=Name}" Width="200"/> </DataGrid.Columns> </DataGrid> </Grid> </Window> MainWindow.xaml.cs using System.Windows; using System.Collections.ObjectModel; namespace SimpleGridTest { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private ObservableCollection<Employee> _employees = new ObservableCollection<Employee>(); public ObservableCollection<Employee> Employees { get { return _employees; } set { _employees = value; } } public MainWindow() { InitializeComponent(); grid.ItemsSource = Employees; } } } How can I fix this problem? Or I need to write a DataGrid***Column as DataGridTextColumn? Thanks in advance! Best Regards, Johnson

    Read the article

  • Windows authetication with Silverlight custom binding.

    - by sfx
    Hello, I am trying to set up security within a web.config file for a WCF service hosted in IIS but keep getting the error message: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. I have read Nicholas Allen’s blog (link text) and it appears that this is the route that I need to take. However, I am using “binaryMessageEncoding” in a customBinding for my Silverlight service, and as such, I’m not sure how to apply this type of security to such an element. This is how my custom binding looks in config at present: <customBinding> <binding name="silverlightBinaryBinding"> <binaryMessageEncoding /> <httpTransport /> </binding> </customBinding> Has anyone had any experience getting Windows authentication to work with a custom binding using binaryMessageEncoding? Cheers, sfx

    Read the article

  • iPhone - Custom Tab Icons, Remove Highlight

    - by user269737
    I am creating a custom tab bar for my iPhone app and I need to change the images. I have changed the actual tab bar background, but I need to know how to add custom images for the icons and their respective "selected" icons. I also need to remove the square highlight that is default. Pretty much, it just needs to be my icons. Also wondering if the images can be coloured or not. I've looked a lot of this, but no one seems to have the solution. Someone please help.

    Read the article

  • Custom Attributes in Android

    - by Arun
    I'm trying to create a custom attribute called Tag for all editable elements. I added the following to attrs.xml <declare-styleable name="Spinner"> <attr name="tag" format="string" /> </declare-styleable> <declare-styleable name="EditText"> <attr name="tag" format="string" /> </declare-styleable> I get an error saying "Attribute tag has already been defined" for the EditText. Is it not possible to create a custom attribute of the same name on different elements?

    Read the article

  • Custom control packaging

    - by CSharpened
    Quick question: You are building a setup for your application. The application contains a custom control developed by you, which will be shared across multiple applications. How should you package the custom control? Package the control in a Merge Module (.msm) and add the .msm file to a Windows Installer project. Package the control into a cabinet project (.cab) and add the .cab file to a Windows Installer project. Create a separate directory for the control and then package it in a Windows Installer project along with the rest of the project files. Package the control as a Web setup project and create a link to that project from the Windows Installer project. Any ideas?

    Read the article

  • Trouble Copying custom class initialization

    - by Parad0x13
    I have a custom class of type NSObject that contains a single NSMutableArray. This class is called Mutable2DArray and is designed to emulate a 2 dimensional array of type NSMutableArray. There is a custom init method - (id)initWithX:(int)x Y:(int)y that asks for the dimensions for the array and allocates the required arrays within the only array the class owns. My issue is when I try to copy an instance of Mutable2DArray I get an error saying the copyWithZone is an unrecognized selector. I thought copy was a base method of NSObject so I'm confused why I cant create a copy of the instance like this: Mutable2DArray *Array1 = [[Mutable2DArray alloc] initWithX:10 Y:10]; Mutable2DArray *Array2 = [Array1 copy]; Am I missing something so obvious here?

    Read the article

  • Modifying the Label Property(text and font) by a custom ComboBox

    - by BDotA
    I have created a custom combobox that has a LABEL property so when we drop it on a form, we can say the Label associated with this ComboBox is say Label2 this is what I wrote for its label property. The whole thing I want to do is that when I am assigning the Label property of my custom ComboBox to one of the labels on the form, I want that label to change its font to bold and also add an "*" to its Test property. thats it ... but it does not work! any ideas? private Label assignedLabelName; public Label AssignedLabelName { get { return assignedLabelName; } set { assignedLabelName = value; assignedLabelName.Text = "*" + assignedLabelName.Text; assignedLabelName.Font = new Font(AssignedLabelName.Font, FontStyle.Bold); } }

    Read the article

  • Creating vCard action result

    - by DigiMortal
    I added support for vCards to one of my ASP.NET MVC applications. I worked vCard support out as very simple and intelligent solution that fits perfectly to ASP.NET MVC applications. In this posting I will show you how to send vCards out as response to ASP.NET MVC request. We need three things: some vCard class, vCard action result, controller method to test vCard action result. Everything is very simple, let’s get hands on. vCard class As first thing we need vCard class. Last year I introduced vCard class that supports also images. Let’s take this class because it is easy to use and some dirty work is already done for us. NB! Take a look at ASP.NET example in the blog posting referred above. We need it later when we close the topic. Now think about how useful blogging and information sharing with others can be. With this class available at public I saved pretty much time now. :) vCardResult As we have vCard it is now time to write action result that we can use in our controllers. Here’s the code. public class vCardResult : ActionResult {     private vCard _card;       protected vCardResult() { }       public vCardResult(vCard card)     {         _card = card;     }       public override void ExecuteResult(ControllerContext context)     {         var response = context.HttpContext.Response;         response.ContentType = "text/vcard";         response.AddHeader("Content-Disposition", "attachment; fileName=" + _card.FirstName + " " + _card.LastName + ".vcf");           var cardString = _card.ToString();         var inputEncoding = Encoding.Default;         var outputEncoding = Encoding.GetEncoding("windows-1257");         var cardBytes = inputEncoding.GetBytes(cardString);           var outputBytes = Encoding.Convert(inputEncoding,                                 outputEncoding, cardBytes);           response.OutputStream.Write(outputBytes, 0, outputBytes.Length);     } } And we are done. Some notes: vCard is sent to browser as downloadable file (user can save or open it with Outlook or any other e-mail client that supports vCards), File name is made of first and last name of contact. Encoding is important because Outlook may not understand vCards otherwise (don’t know if this problem is solved in Outlook 2010). Using vCardResult in controller Now let’s tale a look at simple controller method that accepts person ID and returns vCardResult. public class ContactsController : Controller {       // ... other controller methods ...       public vCardResult vCard(int id)     {         var person = _partyRepository.GetPersonById(id);         var card = new vCard                 {                     FirstName=person.FirstName,                     LastName = person.LastName,                     StreetAddress = person.StreetAddress,                     City = person.City,                     CountryName = person.Country.Name,                       Mobile = person.Mobile,                     Phone = person.Phone,                     Email = person.Email,                 };           return new vCardResult(card);     } } Now you can run Visual Studio and check out how your vCard is moving from your web application to your e-mail client. Conclusion We took old code that worked well with ASP.NET Forms and we divided it into action result and controller method that uses vCard as bridge between our controller and action result. All functionality is located where it should be and we did nothing complex. We wrote only couple of lines of very easy code to achieve our goal. Do you understand now why I love ASP.NET MVC? :)

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >