Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 224/433 | < Previous Page | 220 221 222 223 224 225 226 227 228 229 230 231  | Next Page >

  • Detecting Enter KeyPress on VB.NET 2008

    - by Tareq
    I am using 3.5 framework of VB.NET 2008. I have some textboxes in my form. I want the tab like behavior when my user presses ENTER on one of my textboxes. I used the following Code: Private Sub txtDiscount_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtDiscount.KeyPress If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then SendKeys.Send("{TAB}") e.Handled = True End If End Sub But It doen't work for me. Please give me a solution.

    Read the article

  • How do you programmatically set a Style on a View?

    - by Greg
    I would like to do something like this: <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_cotent" style="@style/SubmitButtonType" /> But in code The xml approach works fine provided that SubmitButtonType is defined. Now what I assume happens is that the appt parser runs through this xml, generates an AttributeSet. That AttributeSet when passed to context/theme#obtainStyledAttributes() will have the style ref mask anything that is not written inline in this tag. Great that's fine! Now how do we do this programmatically. Button, as well as other View types, has a constructor that has the form: <Widget>(Context context, AttributeSet set, int defStyle). So I thought this would work. Button button = new Button(context, null, R.style.SubmitButtonType); However, I am finding that defStyle is badly documented as it really should be written to be a resourceId to an attribute (from R.attrs) that will be passed to obtainStyledAttributes() as the attribute resource, and not the style resource. After looking at the code, all the view implementations seem to pass 0 as the styleRef. I don't see the harm in having it passed as both the attr and the style resource (more flexible and negligible overhead) However I might be approaching this all wrong. How do you do this in code then other than by setting each individual element of the style to the specific widget you want to style (only possible by looking a the code to see what param maps to which method or set of methods). The only way I have found to do this is: <declare-styleable> <attr name="totallyAdhoc_attribute_just_for_this_case" format="reference"> </declare-styleable> <style name="MyAlreadyExistantTheme" > ... ... <item name="totallyAdhoc_attribute_just_for_this_case">@style/SubmitButtonType</item> </style> And instead of passing R.style.SubmitButtonType as defStyle, I pass the new R.attr.totallyAdhoc_attribute_just_for_this_case. Button button = new Button(context, null, R.attr.totallyAdhoc_attribute_just_for_this_case); This works but sounds way too complicated.

    Read the article

  • Working with Multiple Layers - KineticJS

    - by Bruno Sampaio
    I'm using KineticJS 4.0.5 and I'm currently trying to draw the contents of several layers but only the last one added to stage is drawn... If I understood the documentation correctly this should be possible, otherwise why would we need a layer? I have three different layers: a background layer with just a Kinectic.Rect object; a elements layer with several types of shapes; and a top layer with elements I want to be always on top of everything. I populate those layers inside a draw function I have inside a object I created, this object also has a shape attribute which refers to the background and a contents attribute with the elements to add to the elements layer. My code for the draw function is the following: this.draw = function() { var stage = E.game.stage, layers = E.game.layers; stage.clear(); // Add Background this.shape.setSize(stage.getWidth(), stage.getHeight()); layers.background.add(this.shape); // Iterate over contents for(var i = 0; i < this.contents.length; i++) { layers.elements.add(this.contents[i].shape); } // Draw Everything stage.add(layers.background); stage.add(layers.elements); stage.add(layers.top); // This one is currently empty stage.draw(); } After running this function, only layers.top is drawn in the canvas, and if I comment the line where it is added only layers.elements is drawn. However the stage has 3 childrens (I checked it with inspect element on chrome) and in the documentation it says the draw function draws all layers... Am I doing something wrong here? Or it isn't possible? And if it's not possible why would I need a layer and a stage? Wouldn't one be enough? Thank you in advance. Edit: I was able to solve the problem, I was applying a white background color with css to the canvas element and since each layer creates a new canvas element above the others I could only see the contents for the top most layer (in this case just white). However, I still have a problem related with multiple layers that I didn't have before with just one layer. When I use the clear function on the stage it should clear the layers right? But instead the layers remain exactly the same, even if I try to call clear on each individual layer they won't change... I'm also using the stage draw function after clearing them but still no changes at all... The only solution I found until now was by removing the layer from the stage and adding it again :s Is there a better way to reset the layers contents? Thank you again and sorry for the confusion with the first question.

    Read the article

  • label in xsl - change the text

    - by naz
    hi, if i want that some value from the xml insert into the text area in the label in the xsl. how can i do that? for example if i want that the ID attribute inser into the label foreach ID.

    Read the article

  • Magento and configurable product attributes

    - by artega
    I have an issue with displaying product custom attributes. I've read every resources through google but still no success. The problem is that I have to show size attribute of configurable product on category grid and list view. Every solution on google suggested something like $_product->getAttributeText('size') but I ended up at just a single string - "S" or "M" instead of an array. How can I fetch all possible sizes of all simple products which belongs to particular configurable product without much hassle?

    Read the article

  • Need help with Ubercart invoice template

    - by frednwright
    I want to display the price adjustment of an attribute on the customer's invoice. so, for example the customer's invoice would contain this; Products on order: 1 x Blue Sweater - $15 SKU: 22810R Weave: coarse $1.95 Wool: Marino $3.00 Weave and Wool would be the attributes with their price adjustments. I know this is controlled in the Ubercart invoice template, but I am looking for the PHP mod to display the price after the option. THANKS!

    Read the article

  • Syncing Online Content with iPhone Application

    - by PF1
    Hi Everyone: I am looking for some way to sync a online XML file with my iPhone application and only download the newest changed items. Each item is marked with a date attribute, so I assume this is possible. I have heard that Core Data can accomplish this task, but I am unsure of the suggested method and how to approach implementing it. Thanks for any help.

    Read the article

  • iOS Core Data migration: moving something from an entity into a file

    - by Tim Sullivan
    I have a scenario where I'm moving the contents of a blob stored in a core data entity into a file. I need a way to export that data during a migration, where I know the entity that's being converted and save the blob to a file, writing the location of that file into the converted entity's appropriate attribute. I can't seem to find a way to do this. The docs regarding the Three Stage Migration seem to indicate what can be done, but I'm not sure where to define things, or what exactly to define.

    Read the article

  • scala: Adding attributes (odd and even rows) to xml table

    - by Debilski
    In a Lift application, I’d like to add a special tag which takes the <tbody> part of the next table and adds odd and even classes (for example) to each <tr> tag. Alternating, of course. While I have found a way to add another attribute to all <tr> tags, there are still a few problems left (see code below). First, it doesn’t work. cycle.next is called too often, so in the end, everything is an odd row. Other problems are that the code doesn’t exclude inner tables (so a nested <tr> would be transformed as well) and that it also affects the <thead> part of the table. Ideas to make this code work? (Of course, if there already is a lift-based solution – without jQuery – for this, I’ll gratefully take it.) class Loop(val strs: String*) { val stream_iter = Stream.continually(strs.toStream).flatten.iterator def next = stream_iter.next } val cycle = new Loop("even", "odd") val rr = new RewriteRule { override def transform(n: Node): Seq[Node] = n match { case elem : Elem => elem match { case Elem(_, "tr", att @ _, _, _*) => elem % Attribute(None, "class", Text( List(att.get("class").getOrElse("").toString, cycle.next).reduceLeft(_+" "+_).trim ), Null) toSeq case other => other } case other => other } } val rt = new RuleTransformer(rr) val code = <table> <thead><tr><td>Don’t</td><td>transform this</td></tr></thead> <tbody> <tr class="otherclass"> <td>r1c1</td><td>r1c2</td> </tr> <tr> <td>r2c1</td><td>r2c2</td> </tr> <tr> <td>r3c1</td><td>r3c2</td> </tr> </tbody> </table> println(rt(code))

    Read the article

  • python destructuring-bind dictionary contents

    - by Stephen
    Hi, I am trying to 'destructure' a dictionary and associate values with variables names after its keys. Something like params = {'a':1,'b':2} a,b = params.values() but since dictionaries are not ordered, there is no guarantee that params.values() will return values in the order of (a,b). Is there a nice way to do this? Thanks

    Read the article

  • Django model help

    - by dotty
    Does anyone have any clue why this doesn't work as expected. If i use the python shell and do team.game_set or team.games It returns an error AttributeError: 'Team' object has no attribute 'game' If i create a Game object and call game.home_team it returns the correct team object Heres my model class Team(models.Model): name = models.CharField(blank=True, max_length=100) class Game(models.Model): home_team = models.ForeignKey(Team, related_name="home_team")

    Read the article

  • foo and _foo - about variables inside a class

    - by kame
    class ClassName(object): """ """ def __init__(self, foo, bar): """ """ self.foo = foo # read-write property self.bar = bar # simple attribute def _set_foo(self, value): self._foo = value def _get_foo(self): return self._foo foo = property(_get_foo, _set_foo) a = ClassName(1,2) #a._set_foo(3) print a._get_foo() When I print a._get_foo() the function _get_foo prints the variable self._foo . But where does it come from? self._foo and self.foo are different, aren't they?

    Read the article

  • Wait set time for user input C#

    - by Marlon
    I need to know how to wait at set amount of time (about 10 seconds), for a user to input a key or set of keys, before proceeding with an 'auto run' portion of the application. This is bugging me because I can't quite figure out how the timer works, or threading.sleep, what should I use? Been googling all day.

    Read the article

  • can this simple SQL query be optimized?

    - by ibiza
    Hi, I have the following query : SELECT COUNT(*) FROM Address adr INNER JOIN Auditable a on adr.UniqueId = a.UniqueId on a big DB (1.3M adresses, 4M+ auditables) both UniqueId columns are clustered primary keys the query is taking quite long to complete...I feel dumb, but is there any way to optimize it? I want to count all the address entries that have an underlying auditable... thanks!

    Read the article

  • Stop duplicates from being added to an array of Ruby objects

    - by Dom
    how can I eliminate duplicate elements from an array of ruby objects using an attribute of the object to match identical objects. with an array of basic types I can use a set.. eg. array_list = [1, 3, 4 5, 6, 6] array_list.to_set => [1, 2, 3, 4, 5, 6] can I adapt this technique to work with object attributes? thanks

    Read the article

  • Unable to open images with Python's Image.open()

    - by ensnare
    My code reads: import Image def generateThumbnail(self, width, height): """ Generates thumbnails for an image """ im = Image.open(self._file) When I call this function, I get an error: ? AttributeError: type object 'Image' has no attribute 'open' However in the console: import Image im = Image.open('test.jpg') I have no problem. Any ideas? Thanks!

    Read the article

  • Eclipse BIRT - XHTML output

    - by Etienne
    Is there a way to set BIRT to output a report as XHTML (1.0 Transitional would be fine) instead of HTML? I did a few tests and there are some elements that are not valid:head does not include a title, html must have a namespace (xmlns) attribute Is this functionality supported at all by BIRT?

    Read the article

  • odd validation error messages with authlogic

    - by peter
    i have an issue where when validation fails, i get messages like "{{count}} errors prohibited this {{model}} from being saved" and "{{attribute}} {{message}}". it looks like something isn't getting expanded correctly. i've tried adding validates_* stuff but it doesn't seem to help. i've also tried to search the web for an answer but when i add the '{{' and '}}' i get no results. what am i missing? how can i fix this? thanks, -peter

    Read the article

  • jquery adding new class aconfiguration on id?

    - by dupdup
    <area shape="poly" coords="63,10,64,38,89,37,91,10" class={"strokeColor:'0000ff',strokeWidth:5, fillColor:'ff0000',fillOpacity:0.6}" href="#" id="x1"> There is a imagemap in my html and I want to dynamicly add a new configuration "alwaysOn:true" to the class attribute. $("#x1").click(function(){alert(8);}) I am newbea I can add click listener to it but cannot figure out how to add config option How can I do that with jquery?

    Read the article

< Previous Page | 220 221 222 223 224 225 226 227 228 229 230 231  | Next Page >