How To Highlight Similar Item/s and Fix Bugs in VB (Search ListView)

558fe5180e0e8fc922d31c23ef84d240

So my problem is that when I type for example "prod" in the SrchTBox and then click SrchBtn, it will only highlight "Product 2" but not "Product 1" even though they both have "prod" in their item name, how can I highlight any 2 or more relevant items? Also, how can I search items without the problem of worrying about case-sensitivity? That happened when I typed "prod" and it highlights the last item which is "Product 2" but not "Product 1." How can I also fix the bug where the program cannot read the text that I typed? (For example, I typed "rod" in the SrchTBox and a pop-up message shows up and it said, "No match has been found.")

NOTE: The problem is in SrchBtn.

Dim prdt As String() = New String(3) {}
Dim slctprdt As ListViewItem

Dim prdtName As String
Dim price As String
Dim qtty As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    ProductListView.View = View.Details
    ProductListView.GridLines = True
    ProductListView.FullRowSelect = True

    ProductListView.Columns.Add("Product Name", 126)
    ProductListView.Columns.Add("Price", 93)
    ProductListView.Columns.Add("Quantity", 93)

    prdt(0) = "Product 1"
    prdt(1) = "100"
    prdt(2) = "10"
    slctprdt = New ListViewItem(prdt)
    ProductListView.Items.Add(slctprdt)

    prdt(0) = "Product 2"
    prdt(1) = "200"
    prdt(2) = "20"
    slctprdt = New ListViewItem(prdt)
    ProductListView.Items.Add(slctprdt)

End Sub
Private Sub SlctBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    If ProductListView.SelectedItems.Count = 0 Then
        MsgBox("ERROR: No items selected")
    Else
        prdtName = ProductListView.SelectedItems.Item(0).SubItems(0).Text
        price = ProductListView.SelectedItems.Item(0).SubItems(1).Text
        qtty = ProductListView.SelectedItems.Item(0).SubItems(2).Text

        MsgBox(prdtName & " " + price & " " & qtty)
    End If

End Sub
Private Sub AddPrdtBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    Dim prdt As String() = New String(3) {}
    Dim slctprdt As ListViewItem

    If PrNTBox.Text <> Trim("") And PTBox.Text <> Trim("") And QTBox.Text <> Trim("") Then
        prdt(0) = PrNTBox.Text
        prdt(1) = PTBox.Text
        prdt(2) = QTBox.Text
        slctprdt = New ListViewItem(prdt)
        ProductListView.Items.Add(slctprdt)
        PrNTBox.Clear()
        PTBox.Clear()
        QTBox.Clear()
    Else
        MsgBox("ERROR: Incomplete textboxes")
    End If

End Sub

Private Sub SrchBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SrchBtn.Click

    Dim srchTxt = Me.SrchTBox.Text

    If srchTxt = String.Empty Then
        MsgBox("Please enter the search box first.")
    Else
        Dim strtIndx = 0
        Dim prdt As ListViewItem = Nothing

        If Me.ProductListView.SelectedItems.Count = 1 AndAlso Me.ProductListView.SelectedItems(0).Text = srchTxt Then
            strtIndx = Me.ProductListView.SelectedIndices(0) + 1
        End If

        If strtIndx < Me.ProductListView.Items.Count Then
            Do
                prdt = Me.ProductListView.FindItemWithText(srchTxt, False, strtIndx)

                If prdt Is Nothing OrElse prdt.Text = srchTxt Then
                    Exit Do
                End If

                strtIndx = prdt.Index + 1

                If strtIndx >= Me.ProductListView.Items.Count Then
                    Exit Do
                End If
            Loop
        End If

        Me.ProductListView.SelectedItems.Clear()

        If prdt Is Nothing Then
            MsgBox("No match has been found.")
        Else
            prdt.Selected = True
            prdt.EnsureVisible()
            Me.ProductListView.Select()
        End If
    End If
End Sub

WordPress 5.7 Introduces Drag-and-Drop for Blocks and Patterns, Streamlined Admin Color Palette, and One-Click Migration from HTTP to HTTPS

Category Image 091

WordPress 5.7 “Esperanza” was released today, named for Esperanza Spalding, an American jazz bassist who became an accomplished singer, songwriter, and composer in her early 20’s.

Versions 9.3 – 9.9 of the Gutenberg plugin are rolled into this update, bringing hundreds of enhancements and bug fixes that make working in the block editor more efficient and enjoyable.

One of the highlights is the new drag-and-drop capabilities in the block inserter. Users can now drag blocks and block patterns directly into the post content area, making page building even faster.

Many of the user-facing editor enhancements in this release give the user more control when using existing blocks:

  • Full height alignment: Blocks such as the Cover block now can have an option to expand to fill the entire viewport.
  • Buttons block: The Buttons block now supports vertical alignments, and you can set the width of a button to a preset percentage.
  • Social Icons block: You can now change the size of the icons in the Social Icons block.
  • Font size in more places: You can now change the font size in the List and Code blocks

This release also improves the UI for block variations to include the icon and description for the variation in the block inspector and a new dropdown to allow for switching between variations. Reusable blocks have been updated to be saved at the same time the post is saved. Quite a few more improvements have been added in version 10.1 of the Gutenberg plugin, which is not yet included core. If you use Reusable blocks frequently, you may want to install the plugin to take advantage of the expanded UI.

In addition to all the editor improvements, WordPress 5.7 introduces a streamlined color palette for the admin. It standardizes the palette to seven core colors and a range of 56 shades. One of the benefits is that all the shades meet the requirements for WCAG 2.0 AA recommended contrast ratio against white or black.

New Admin Color Scheme

Theme and plugin developers who want to better match the admin color scheme can easily reference the new standardized shades to make their products more at home in the WordPress admin. WordPress’ existing core classes have also been updated with the new color palette so plugin authors can use them to work within the new standardized palette.

One of the most exciting technical enhancements in 5.7 is a new one-click migration from HTTP to HTTPS. WordPress can now detect if the user’s hosting environment has support for HTTPS and update with the click of a button, handling mixed content rewrites where possible. This feature is available on the Site Health recommendations screen.

WordPress 5.7 continues the ongoing cleanup after the update to jQuery 3.5.1, which will eventually result in the removal of jQuery Migrate plugin. It fixes numerous jQuery deprecations in external libraries, cleaning up many JQMIGRATE warnings.

Developers may also be interested in the new filter-based Robots API included in 5.7. It enables the central management of the content of the robots meta tag injected into the page, and includes a setting to toggle whether search engines are allowed to display large media from the site. By default, a max-image-preview:large robots directive which will be injected into the robots meta tag based on the new setting.

Version 5.7 also includes native support for lazy loading iframes, a follow-up to WordPress’ support for lazy loading for images that came in 5.5. This should improve loading for pages that include embeds and other types of iframes.

Check out the WordPress 5.7 field guide for technical details on everything new in this release. This update is the result of work from 481 volunteer contributors who collaborated on 250 tickets on Trac and more than 950 pull requests on GitHub.

5 Key Security Protocols for WooCommerce Sites

Featured Imgs 26

5 Key Security Protocols for WooCommerce SitesWooCommerce sites certainly have unique needs in terms of web security, and as e-commerce increases worldwide, so does the risk of fraud and security breaches. Online security really is a basic requirement, just like the health inspection rating of a restaurant, and any issues that arise in your online store can undermine your web visitor’s […]

The post 5 Key Security Protocols for WooCommerce Sites appeared first on WPExplorer.

Add/Change Address on Receipts

Featured Imgs 23

We don’t ask for your address when you sign up for CodePen PRO. We don’t need it, as we don’t need to send you anything and we don’t really adjust anything based on your location. But it’s entirely understandable that you might want your address on a receipt of purchase. We get that request all the time. Now, rather than any sort of work-around, we allow you to enter an address that we’ll use for putting on those reciepts.

In your Settings > Billing, you’ll find an “Update Address” button.

Now when you open a receipt for any past charge (available always at Settings > Billing), that address will be there:

Note in the screenshot above I’ve clicked into the address area. That area is always editable, so you can manipulate one-off invoices before printing or saving as PDF, as needed.

Need to add a VAT?

Feel free to use one of the address lines for that, like Address 2 or Country. All these fields do is just output onto the receipt, so you can use them for whatever you need.

The post Add/Change Address on Receipts appeared first on CodePen Blog.

MemberPress Creators Have Earned over $1 billion dollars (Milestone Update)

Category Image 091

It’s always mind blowing for me to see the impact WordPress makes on the global economy.

MemberPress, the leading WordPress membership and course platform, announced today that they have passed the milestone of $1 billion dollars in creator earnings.

This is a conservative estimate and likely MemberPress creators have earned way more than that.

MemberPress Billion Dollar Creator Earning Milestone

With the digital acceleration from last year, they are estimating that MemberPress site creators are projected to earn over $600 million dollars in 2021 alone.

For those who don’t know, I invested in MemberPress in 2018 as part of our WPBeginner Growth Fund.

It’s been an exciting journey to work alongside with Blair Williams, founder & CEO of MemberPress.

The impact our users (website creators) are making through their online courses and membership sites is truly humbling to watch.

Note: Want to add premium content on your site? See our step by step guide on how to create a membership site, and how to sell online courses in WordPress.

Product Update from MemberPress

Last year, MemberPress launched an easy to use online course builder that works on top of the WordPress block editor. This makes it easy for non-techy website owners to create courses, add lessons, manage access control, and more.

Creating the sections and lessons for your course

The team also added a Classroom mode to offer a distraction-free learning experience that’s focused on content consumption and course completion rate. This immersive learning mode works with all WordPress themes.

The MemberPress course curriculum that users see, showing their progression through the course

Aside from the huge update on Courses, MemberPress also made it seamless to add premium content protection for various top page builder plugins such as Divi, Elementor, Beaver Builder, WP Bakery, etc.

They also made significant improvements to add drip content in WordPress, ability to gift memberships, added PDF invoices, integrations with PushEngage, and more.

I also got a sneak peek of some big features they’re working on, and it’s going to be an exciting 2021.

What Can You Use MemberPress for?

MemberPress is the best WordPress membership plugin and online course platform for many reasons.

Here’s what you can do with MemberPress:

Basically if you want to restrict access to any type of premium content in WordPress, then you should use MemberPress.

Final Thoughts on WordPress & Creator Economy

The WordPress economy and indirectly the creator economy is huge. In the State of Word for 2020, Matt Mullenweg, co-founder of WordPress shared that WooCommerce facilitated over $20 billion in sales in 2020.

Other third-party online course platforms like Teachable reported that course creators earned over $456.7 million in 2020. Thinkific is also estimating their course creators to earn around $550 million in 2021.

MemberPress is estimating that creators using MemberPress will surpass estimated $600 million in sales in 2021, and this is a conservative estimate.

The creator economy has been on the rise since I started WPBeginner in 2009, but it’s never been stronger than right now.

If you have the knowledge and passion for teaching others, then you can start a very successful online business today.

The combination of YouTube, membership platforms, and social networks for building community provide a unique opportunity for anyone who has a desire to succeed.

As a content creator myself, it’s extremely rewarding for me to see others succeed in their online journey.

I want to congratulate Blair and the MemberPress team in their role for building a robust platform that supports thousands of creators find success online.

Here’s to an amazing 2021!

P.S. If you have a WordPress product that’s empowering website owners to succeed online and want to work with us, then I would love to chat with you. Click here to learn more about WPBeginner Growth Fund.

The post MemberPress Creators Have Earned over $1 billion dollars (Milestone Update) appeared first on WPBeginner.

New Technologies of Computer

Category Image 041

There has been a lot of technologies that have brought a significant change in our daily life. Because of the invention of the computer, our life has become so much easier. So here we discuss various technologies that have been kept on improving and will keep on improving.

Simple Solutions to Create a WordPress Knowledge Base

Featured Imgs 26

Simple Solutions to Create a WordPress Knowledge BaseA comprehensive knowledge base can do much to improve your business, both internally and as a vital part of your customer service efforts. However, if you’re thinking about adding one to your website, you may find yourself a bit overwhelmed by the prospect. Thanks to the plethora of benefits a knowledge base provides, there are […]

The post Simple Solutions to Create a WordPress Knowledge Base appeared first on WPExplorer.

Solid Design Principles Review

Featured Imgs 26

In this article series, we will examine SOLID Design Principles: what are they, and what are they meant to do?

First of all, we will look at the brief history behind the principles; later on, we will see why it is so important to use SOLID principles in our day-day designs, and then finally we will dive into the details of the principles.

Weekly Platform News: Focus Rings, Donut Scope, More em Units, and Global Privacy Control

Category Image 091

In this week’s news, Chrome tackles focus rings, we learn how to get “donut” scope, Global Privacy Control gets big-name adoption, it’s time to ditch pixels in media queries, and a snippet that prevents annoying form validation styling.

Chrome will stop displaying focus rings when clicking buttons

Chrome, Edge, and other Chromium-based browsers display a focus indicator (a.k.a. focus ring) when the user clicks or taps a (styled) button. For comparison, Safari and Firefox don’t display a focus indicator when a button is clicked or tapped, but do only when the button is focused via the keyboard.

The focus ring will stay on the button until the user clicks somewhere else on the page.

Some developers find this behavior annoying and are using various workarounds to prevent the focus ring from appearing when a button is clicked or tapped. For example, the popular what-input library continuously tracks the user’s input method (mouse, keyboard or touch), allowing the page to suppress focus rings specifically for mouse clicks.

[data-whatintent="mouse"] :focus {
  outline: none;
}

A more recent workaround was enabled by the addition of the CSS :focus-visible pseudo-class to Chromium a few months ago. In the current version of Chrome, clicking or tapping a button invokes the button’s :focus state but not its :focus-visible state. that way, the page can use a suitable selector to suppress focus rings for clicks and taps without affecting keyboard users.

:focus:not(:focus-visible) {
  outline: none;
}

Fortunately, these workarounds will soon become unnecessary. Chromium’s user agent stylesheet recently switched from :focus to :focus-visible, and as a result of this change, button clicks and taps no longer invoke focus rings. The new behavior will first ship in Chrome 90 next month.

The enhanced CSS :not() selector enables “donut scope”

I recently wrote about the A:not(B *) selector pattern that allows authors to select all A elements that are not descendants of a B element. This pattern can be expanded to A B:not(C *) to create a “donut scope.”

For example, the selector article p:not(blockquote *) matches all <p> elements that are descendants of an <article> element but not descendants of a <blockquote> element. In other words, it selects all paragraphs in an article except the ones that are in a block quotation.

The donut shape that gives this scope its name

The New York Times now honors Global Privacy Control

Announced last October, Global Privacy Control (GPC) is a new privacy signal for the web that is designed to be legally enforceable. Essentially, it’s an HTTP Sec-GPC: 1 request header that tells websites that the user does not want their personal data to be shared or sold.

The DuckDuckGo Privacy Essentials extension enables GPC by default in the browser

The New York Times has become the first major publisher to honor GPC. A number of other publishers, including The Washington Post and Automattic (WordPress.com), have committed to honoring it “this coming quarter.”

From NYT’s privacy page:

Does The Times support the Global Privacy Control (GPC)?

Yes. When we detect a GPC signal from a reader’s browser where GDPR, CCPA or a similar privacy law applies, we stop sharing the reader’s personal data online with other companies (except with our service providers).

The case for em-based media queries

Some browsers allow the user to increase the default font size in the browser’s settings. Unfortunately, this user preference has no effect on websites that set their font sizes in pixels (e.g., font-size: 20px). In part for this reason, some websites (including CSS-Tricks) instead use font-relative units, such as em and rem, which do respond to the user’s font size preference.

Ideally, a website that uses font-relative units for font-size should also use em values in media queries (e.g., min-width: 80em instead of min-width: 1280px). Otherwise, the site’s responsive layout may not always work as expected.

For example, CSS-Tricks switches from a two-column to a one-column layout on narrow viewports to prevent the article’s lines from becoming too short. However, if the user increases the default font size in the browser to 24px, the text on the page will become larger (as it should) but the page layout will not change, resulting in extremely short lines at certain viewport widths.

If you’d like to try out em-based media queries on your website, there is a PostCSS plugin that automatically converts min-width, max-width, min-height, and max-height media queries from px to em.

(via Nick Gard)

A new push to bring CSS :user-invalid to browsers

In 2017, Peter-Paul Koch published a series of three articles about native form validation on the web. Part 1 points out the problems with the widely supported CSS :invalid pseudo-class:

  • The validity of <input> elements is re-evaluated on every key stroke, so a form field can become :invalid while the user is still typing the value.
  • If a form field is required (<input required>), it will become :invalid immediately on page load.

Both of these behaviors are potentially confusing (and annoying), so websites cannot rely solely on the :invalid selector to indicate that a value entered by the user is not valid. However, there is the option to combine :invalid with :not(:focus) and even :not(:placeholder-shown) to ensure that the page’s “invalid” styles do not apply to the <input> until the user has finished entering the value and moved focus to another element.

The CSS Selectors module defines a :user-invalid pseudo-class that avoids the problems of :invalid by only matching an <input> “after the user has significantly interacted with it.”

Firefox already supports this functionality via the :-moz-ui-invalid pseudo-class (see it in action). Mozilla now intends to un-prefix this pseudo-class and ship it under the standard :user-invalid name. There are still no signals from other browser vendors, but the Chromium and WebKit bugs for this feature have been filed.


The post Weekly Platform News: Focus Rings, Donut Scope, More em Units, and Global Privacy Control appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.