How to add items to a List Control in an MFC dialog


First, make sure you chose the Report option of the View property of the List Control in the Resource Editor. I suspect that you are using the default Icon view, which is not what you want.

Then, you need to add the required columns:

m_lstIDC_LIST1Control.InsertColumn(0, _T("Full Name"),
LVCFMT_LEFT, 90);
m_lstIDC_LIST1Control.InsertColumn(1, _T("Profession"), LVCFMT_LEFT,
90);
m_lstIDC_LIST1Control.InsertColumn(2, _T("Fav Sport"), LVCFMT_LEFT,
90);
m_lstIDC_LIST1Control.InsertColumn(3, _T("Hobby"), LVCFMT_LEFT, 90);

Finally, you can populate your list items simply as follows:

int nIndex = m_lstIDC_LIST1Control.InsertItem(0, _T("Sandra
C. Anschwitz"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 1, _T("Singer"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 2, _T("Handball"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 3, _T("Beach"));

nIndex = m_lstIDC_LIST1Control.InsertItem(1, _T("Roger A. Miller"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 1, _T("Footballer"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 2, _T("Tennis"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 3, _T("Teaching"));

And so on ....



How to change the font size of dialog title and list items?

You can do customizing of dialog title by using setCustomDialog() API.

Sample for the same is as follows,

AlertDialog.Builder builder = new
AlertDialog.Builder(this);    
final TextView myView = new TextView(getApplicationContext());
myView.setText("A Sample Title to Change Dialog Title");
myView.setTextSize(12);

builder.setCustomTitle(myView);


How to add items to a List Control in an MFC dialog

First, make sure you chose the Report option of the View property of the List Control in the Resource Editor. I suspect that you are using the default Icon view, which is not what you want.

Then, you need to add the required columns:

m_lstIDC_LIST1Control.InsertColumn(0, _T("Full Name"),
LVCFMT_LEFT, 90);
m_lstIDC_LIST1Control.InsertColumn(1, _T("Profession"), LVCFMT_LEFT,
90);
m_lstIDC_LIST1Control.InsertColumn(2, _T("Fav Sport"), LVCFMT_LEFT,
90);
m_lstIDC_LIST1Control.InsertColumn(3, _T("Hobby"), LVCFMT_LEFT, 90);

Finally, you can populate your list items simply as follows:

int nIndex = m_lstIDC_LIST1Control.InsertItem(0, _T("Sandra
C. Anschwitz"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 1, _T("Singer"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 2, _T("Handball"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 3, _T("Beach"));

nIndex = m_lstIDC_LIST1Control.InsertItem(1, _T("Roger A. Miller"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 1, _T("Footballer"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 2, _T("Tennis"));
m_lstIDC_LIST1Control.SetItemText(nIndex, 3, _T("Teaching"));

And so on ....


Alert Dialog (List) custom rows for items

Do you really need it to be a Dialog?

You could create a new Activity and adding the dialog theme. If you are working for devices prior to 4.0 you will have to do the following:

Create a folder res/values-v11 (this will work for API 11+) and after doing so, add a file called styles.xml. In this file type the following:

<resources>
    <style name="my_activity_theme"
parent="android:Theme.Holo.Light"/>
</resources>

Then in your styles.xml located in your in /res/values folder add this lines:

<resources>
    <style name="my_activity_theme"
parent="android:Theme.Light"/>
</resources>

and then, apply it to your application in AndroidManifest.xml:

<activity
    ...
    <android:theme="@style/my_activity_theme"/>

</activity

This way you will be able to have a floating activity. I haven't tested it but I think it is worth trying.

Hope it helps


How to put selected items from a CheckBox Dialog in a list?

Check the docs, List is an interface. You already have an array with your checked items isn't it ?

Object[] array = new Object[]{"12","23","34"};
java.util.List list = Arrays.asList(array);

C++ MFC Dialog - How to display items from a MySQL database in a list control?

The problem with your code is, that you insert a row into your list control for every column entry of a database row. You have to insert a new row into your list control only once before your for loop, for example, like this:

while(row = mysql_fetch_row(res))
{
    // Insert a new row at the end of the list control.
    // Do this only once per database row.
    int nNewIndex = m_PplCounterCtrl.GetItemCount();
    int nCurIndex = m_PplCounterCtrl.InsertItem(nNewIndex, row[0]);

    // Insert all remaining database column entries.
    // Insert them into the current row of the list control.
    for(int i = 1; i < mysql_num_fields(res); i++)
    {            
        m_PplCounterCtrl.SetItemText(nCurIndex, i, row[i]);
    }
}

Creating an unordered list whose list items control which image will be displayed

This is very simpel:

Make shure that the hover maps are on top of the default map (play around with positoning) and set their opacity to 0;

overlay{
    opacity: 0;
}

I added some extra classes to easely access the maps with jQuery:

<div class="world-map">
 <ul class="region-list">
  <li class="europe">Europe<li> 
  <li class="america">America</li>
  <li class="africa">Africa</li>
  <li class="asia">Asia</li>
 </ul>
 <div class="image-container">
  <img class="default" src='images/map/default-world-map.png'>
  <img class="overlay europe" src='images/h-europe.png'>
  <img class="overlay america" src='images/h-america.png'>
  <img class="overlay africa" src='images/h-africa.png'>
  <img class="overlay asia" src='images/h-asia.png'>
 </div>
</div>

Then you can do something like:

$('.region-list li').hover(
    function () {
       $('.image-container')
       .find('.' + $(this).attr('class'))
       .animate({opacity: 1}, 200);
    },
    function () {
        $('.image-container')
       .find('.' + $(this).attr('class'))
       .animate({opacity: 0}, 200);
 });

What im doing here? When hovering the "name - listitems" im searching for li items with a similar class name and animate their opacitiy to 1. When loosing the focus it automatically animates the opacity back to 0.

This code is not tested it should you give an idea of how to achieve somthing like this.



- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow