Skip to main content

Posts

Showing posts from August, 2017

Android Custom ListView

In android, we can populate the listView with single textView. But what if we want button, images etc. in each item of the listView. For achieving this, we have to implement a customized adapter. Let's take an example where listView contains name and a delete button for each name like this- 1. Create a new project in android studio, fill all the necessary details. 2. Open activity_main.xml, and add a listView in the code. <? xml version = "1.0" encoding = "utf-8" ?> <RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"     xmlns:tools = "http://schemas.android.com/tools"     android:id = "@+id/activity_main"     android:layout_width = "match_parent"     android:layout_height = "match_parent"     android:paddingBottom = "@dimen/activity_vertical_margin"     android:paddingLeft = "@dimen/activity_horizontal_margin"     android:paddingRight...

Calculator using Windows Form

Following are the steps to make calculator using windows form- 1. Create a new wpf project in visual studio. File>New>Project>windows>wpf application 2. Add a new form in the solution Right click solution then click add>new item and a new windows form. 3.Add textbox and buttons from the tool box in the form and change colors if you want. 4. Right click button then properties>name (change name). Do this for all of the buttons and give them appropriate names. 5. Double click the buttons to add buttonClick methods in Form1.cs file. 6.Implement buttonClick methods. On click of a digit add the respective number in the textbox. Example- 7.Now we will implement add,sub,mul,div,mod etc methods on the respective button clicks. a. Declare boolean variables to know which operator is currently in use and two doubles variables.   double  operand1, operand2 ;   bool   add , sub, mul, div,mod ; ...