[Tex/LaTex] customize beamer block environment: underline block title

beamerblockunderline

I'm trying to define an underlined block title in beamer and I'm unable to do it. Could anybody help me with that?
I managed to customize the specific font and shape of the block title, but so far no success with the underlining.
My (successful) code is the following:

\setbeamerfont{block title}{size=\normalsize, series=\bfseries}

\underline command is not working (neither is \ul with the soul package)…
Any help welcome!

Best Answer

With this: (taken from here Changing default width of blocks in beamer)

\documentclass[10pt,a4paper]{beamer}
\usepackage[latin1]{inputenc}
\usetheme{Warsaw}


\newenvironment<>{varblock}[2][\textwidth]{%
    \setlength{\textwidth}{#1}
    \begin{actionenv}#3%
        \def\insertblocktitle{\underline{#2}}%
        \par%
        \usebeamertemplate{block begin}}
    {\par%
        \usebeamertemplate{block end}%
\end{actionenv}}
\begin{document}

    \begin{frame}
    \frametitle{Sample frame title}
    This is a text in the first frame. This is a text in the first frame. This is a text in the first frame.
    {\begin{varblock}{title}blabla\end{varblock}}
\end{frame}
\end{document}

Result:

enter image description here