• 締切済み

オブジェクトのプロパティを一気に変更する方法

テキストオブジェクトが一つあります。 文字のフォントやサイズ、表示色やバックグラウンドカラーなどをまとめて変更するステートメントがあったと思うのですが、忘れてしまいました。 textbox.text="1111" textbox.visible=true 等のステートメントを *******(忘れたステートメント) .tex="1111" .visible=true ****** と何かでくくって設定していたと思うのですが思い出せません。

みんなの回答

  • TAGOSAKU7
  • ベストアンサー率65% (276/422)
回答No.1

( ・・)?ン もしかして WITH? With textbox   .text="1111"   .visible=true End With はずしてるかもしれない。

xiaolong_goo
質問者

お礼

それです。 すっきりしました。

関連するQ&A

  • VB6.0でのTextboxの高さ変更

    VB6.0を使用しています。 下記のようにテキストボックスを動的配置した際にボックスの高さを変更したいのですが、文字の大きさ等に依存しているよう?で変更できません。 よく似た質問でMultiline をTrueにするような物があり、試してみましたがエラーとなってしまいます。 もう少し小さくしたいのですが何を変更・追加すればよいのでしょうか? どなたかご教授願います。 Private Sub Form_Load() Dim add_tbox As TextBox Set add_tbox = Controls.Add("VB.textbox", "text") With add_tbox .Text = "aaa" .Height = 240 '---テキストボックスの高さ .Left = 2270 .Top = 1700 .Width = 350 .FontSize = 9 '.MultiLine = False ---これを追加するとエラー"値の取得のみ可能なプロパティに値を設定する事はできません" .Visible = True End With MsgBox add_tbox.Height '---テキストボックスの高さ確認(270となっている) End Sub

  • スピンボタンとテキストボックスの連動

    Excel2000.2003 [UserForm]に [SpinButton1] と[SpinButton2] 及び [TextBox]を縦6 横10の表らしきものを作り パソコン初心者にも使える様、また 入力ミスを防ぐ為に [SpinButton1.2]で必要な箇所[TextBox]の 配置のVisibleをFalse⇔Trueに変え表示するようにしたいのです ---------------------------------------------------------  [TextBox1]     [TextBox2] [SpinButton1]    [SpinButton2] ------------------------------------------- [Text 3][Text 9][Text15][…][…][…][][][][] [Text 4][Text10][Text16][…][…][…][][][][] [Text 5][Text11][Text17][…][…][…][][][][] [Text 6][Text12][Text18][…][…][…][][][][] [Text 7][Text13][Text19][…][…][…][][][][] [Text 8][Text14][Text20][…][…][…][][][][] ---------------------------------------------- [Text 1]は[SpinButton1]の値を表示します(初期値1) [Text 2]は[SpinButton2]の値を表示します(初期値1) [Text 3]は[SpinButton1][SpinButton2]が共に初期値1の為 デフォルトとして表示します。 SpinButton1を増減することにより、例えば SpinButton1="2"の場合 SpinButton2の値を考慮しながら [Text 3][Text 9][Text15][…][…][…][][][][] [Text 4][Text10][Text16][…][…][…][][][][]  VisibleがFalse⇔Trueに変わり  例えば、SpinButton1="2"の場合 SpinButton2を増減すると 列配置の 例えば SpinButton2="1"の場合 SpinButton1の値を考慮しながら [Text 9][Text15][…][…][…][][][][] VisibleがセットでFalse⇔Trueに変わるようにしたいのです。 意味解りますか? どなたか助けてください。

  • 「オブジェクトは、このプロパティまたはメソッドをサポートしていません。」と表示されるのですが…

    以下のコードを事項すると、「オブジェクトは、このプロパティまたはメソッドをサポートしていません。」と表示されて 「objIE.Document.all.ALT_L_NAME.Value = t」の部分が黄色くなります。 解決策をお願いいたします。 (以下、コードとソースの一部です) コード↓ Sub a() Dim objIE As InternetExplorer '参照設定:Microsoft Shell Controls and Automation Dim objShell As Shell Dim WinFlg As Boolean Dim objWin As Object Dim AllLog As Object On Error GoTo EndProcess Set objShell = New Shell For Each objWin In objShell.Windows If TypeName(objWin) = "IWebBrowser2" Then WinFlg = True Set objIE = objWin Exit For End If Next Set objShell = Nothing If WinFlg = False Then MsgBox "IEオブジェクトが取得できません", vbCritical Exit Sub End If EndProcess: If Err() > 0 Then MsgBox Err.Description End If t = Cells(1, 1) objIE.Document.all.ALT_L_NAME.Value = t Set objIE = Nothing End Sub ソース(一部)↓ ・ ・ ・ <SELECT NAME="PRIVILEGE_CODE" onChange=click01()><OPTION VALUE=2>タクナフ </SELECT> </td> </tr> <tr> <td bgcolor="#FFFF93" width="150"> <font color="#660000"> <b>タォ・ユ・・ャ・ハ(チエウム・ォ・ハ)</b></font> </td> <td width="390"> <INPUT TYPE="text" NAME="L_NAME" SIZE="40" MAXLENGTH="16"> </td> </tr> <tr> <td bgcolor="#FFFF93" width="150"> <font color="#660000"> <b>フセ・ユ・・ャ・ハ(チエウム・ォ・ハ)</b></font> </td> <td width="390"> <INPUT TYPE="text" NAME="F_NAME" SIZE="40" MAXLENGTH="16"> </td> </tr> <tr> <td bgcolor="#FFFF93" width="150"> <font color="#660000"> <b>タォ(エチサ・</b></font> </td> <td width="390"> <INPUT TYPE="text" NAME="ALT_L_NAME" SIZE="40" MAXLENGTH="16"> </td> </tr> <tr> <td bgcolor="#FFFF93" width="150"> <font color="#660000"> <b>フセ(エチサ・</b></font> </td> <td width="390"> <INPUT TYPE="text" NAME="ALT_F_NAME" SIZE="40" MAXLENGTH="16"> </td> </tr> ・ ・ ・

  • オブジェクト名が同じ図形の変更

    アクティブセル値と同じオブジェクト名のテキストボックスが複数有ります。そのテキストボックスの大きさやテキスト(アクティブセル値と同じ)の内容に書き換えたいと思っています。 サイズとテキスト書き込みのステートメントをFor Eachで括りました。 途中にMsgboxを入れて確認するとボックスの数だけ繰り返しているのは間違いないのですが、変更できるのは1個だけです。 最初に作った(?)テキストボックスのみを何度も書き換えているのかな?と思っているのですが、複数個の変更をするにはどの様にしたらいいのでしょうか。 宜しくお願い致します。 Sub test() A = ActiveCell.Formula For Each shp In ActiveSheet.Shapes If shp.Name = A Then ActiveSheet.Shapes(A).Select Selection.ShapeRange.Height = 19.5 Selection.ShapeRange.Width = 19.5 With ActiveSheet.Shapes(A).TextFrame .Characters.Text = A End With With Selection.Font .Size = 7 End With End If Next shp End Sub

  • マクロにてオブジェクトの線を太線にするには?

    テキストBOXとオブジェクトが数個混在しているシートにおいて、 1.テキストBOXは文字有りで枠線なし 2.オブジェクトは線あり の場合で、 ドラッグして選択した任意の個数のテキストBOXの文字は太字に                 オブジェクトの線は太線に 変更するマクロを作りたいのですが、よろしくおねがいします。 ちなみに、EXCELでは以下でOKです。 Sub aaa()   Dim SelOb As Object   Set SelOb = Selection   If TypeName(SelOb) = "DrawingObjects" Then     For Each DrOb In SelOb       If TypeName(DrOb) = "TextBox" Then        Selection.Font.Bold = True       Else        Selection.ShapeRange.Line.Weight = 1.5       End If     Next   End If   Set SelOb = Nothing End Sub

  • イラストレーターでの文字の大きさの変更方法

    イラストレーターVer10を使用しています。 文字を入力し、編集する際、文字大きさを変えたい時は、いちいち文字設定ウィンドウの文字サイズ設定の数値を変更しながら、設定するしか方法は無いのでしょうか? 文字のオブジェクトを選択し、マウスで引き伸ばしたり縮めたりして文字の大きさを希望するサイズにすることは出来ないのでしょうか? アウトライン化すれば出来るのですが、それでは今度はフォントを変更することが出来なくなるので、また打ち直さねば成らず面倒です。 よい方法をご存知であれば教えて頂きたいのですが、宜しくお願い致します。

  • ボックス間の隙間を埋める方法

    私が作ったHPなのですが、 タイトルと文字の間に空白が出来てしまっています。 オレンジの背景をくっつけたいのですがどのようにすればよろしいでしょうか? 以下の設定をしています。 h1#title{ height: 40px; margin: 0; float:left; font-size: 35px; padding-right: 2px; color: #ffffff; background-color: #ff6600; } h2#renewal_time{ height: 40px; margin: 0; font-size: 18px; text-align: right; padding-top: 20px; padding-bottom: 0px; background-color: #ff6600; }

    • ベストアンサー
    • CSS
  • リソースエディタでスタティックテキストの文字サイズの変更

     VisualStudio を使っています。  リソースエディタで、作成したダイアログ・ボックス中に貼り付けた、 スタティックテキスト(Static Text)の文字サイズの変更を個別にしたいのです。  ダイアログのプロパティには、フォントとサイズを変更できるようになっていますが、個々のスタティックテキストには、ありません。  どうすれば、一番良いのでしょうか?  教えてください。  よろしくお願いします。  

  • blog CSSのタイトル色の変更指定について!!

    このblog CSSのブログタイトルの色変更はどうすればいいですか? .blogtitle の所で色指定してもダメでした?他に方法があるのですか? livedoor Blog CSS FileName: ネコさん(20040819) Version: 2006.06.26 ----------------------------------------------------- */ #header{} #header td{ color:#FFF; font-size:12px; text-align:right; padding-right:10px; } #header a:link{color:#FFF;} #header a:visited{color:#FFF;} #header a:active{color:#FFF;} #header a:hover{color:#FFF;text-decoration:none;} body{ margin:0; padding:0; text-align:center; font-family: verdana ,arial ,sans-serif; background-color: #4d9d1c; /*background:#4d9d1c url('https://parts.blog.livedoor.jp/old_img_com/img/usr/20040819/bg.gif') repeat-y 50% 0;*/ } a{color:#666;text-decoration:underline;} a:link{color:#666;text-decoration:underline;} a:visited{text-decoration:underline;} a:active{} a:hover{color:#666;text-decoration:none;} #container{ width:833px; margin:0 auto; text-align:left; word-break:break-all; background:url('https://parts.blog.livedoor.jp/old_img_com/img/usr/20040819/header.gif') no-repeat; } #banner,#subbanner{ width:833px; height:185px; margin:0 auto 35px;; } #banner a{color:#fff;text-decoration:none;} #banner a:link{color:#fff;text-decoration:none;} #banner a:visited{text-decoration:none;} #banner a:active{} #banner a:hover{color:#fff;text-decoration:underline;} #subbanner a{color:#fff;text-decoration:underline;} #subbanner a:link{color:#fff;text-decoration:underline;} #subbanner a:visited{text-decoration:underline;} #subbanner a:active{} #subbanner a:hover{color:#fff;text-decoration:none;} h1,h2,h3{margin:0;padding:0;} .blogtitle{ font-size:20px; font-weight:bold; padding-top:85px; padding-right:70px; text-align:right; } .description{ color:#000; font-weight:bold; font-size:12px; padding-right:70px; text-align:right; } #categorytitlebody{} #categorytitle{ font-size:14px; font-weight:bold; text-align:center; padding:20px 10px 15px 10px; } #blogcontainer{width:755px;margin:0 auto auto 20px;background-color:#FFF;} #content{ width:564px; float:left; padding-left:10px; text-align:left; padding-bottom:50px; } #links{ width:170px; float:right; padding-bottom:50px; } .blog{} .date{ color:#4d9d1c; font-size:14px; font-weight:bold; text-align:left; margin-bottom:5px; } .title{ font-size:14px; font-weight:bold; text-align:left; background:url('https://parts.blog.livedoor.jp/old_img_com/img/usr/20040819/nikukyu.gif') no-repeat 0 50%; padding-left:26px; } .blogbody{ line-height:130%; text-align:left; background-color:#f3f1e2; padding:10px 0px 0px 10px; } .main,.mainmore,.portal-links{ line-height:150%; font-size:12px; padding:18px 10px 30px 26px; } blockquote{ padding:5px; margin:5px; border:2px dotted #4d9d1c; } .pict{margin:5px;} .posted{ color:#000; font-size:11px; text-align:left; margin:0; padding:10px 15px 10px 26px; } a.posted{color:#000;text-decoration:underline;} a.posted:link{color:#000;text-decoration:underline;} a.posted:visited{text-decoration:underline;} a.posted:active{} a.posted:hover{color:#000;text-decoration:none;} .menu{ font-size:11px; text-align:right; padding:2px 15px 20px 26px; } .blogbodybottom{ margin-bottom:20px; } .comblogbodybottom{ margin-bottom:20px; } #contentcommentbottom{} .formbodybottom{} #articletop{} #articlebody{} #articlebottom{} .trackbackurlbody{ text-align:left; padding-left:10px; } .trackbackurlttl{ background:url('https://parts.blog.livedoor.jp/old_img_com/img/usr/20040819/nikukyu.gif') no-repeat 0 50%; font-size:12px; font-weight:bold; padding-left:26px; } .trackbackurl{ padding-top:10px; padding-bottom:20px; text-align:left; } .trackbackurl table{width:350px;margin:0 auto;} input.trackbackbox{width:300px;} .trackbackurlbottom{} a.posttitle:link{color:#000;text-decoration:underline;font-si

    • 締切済み
    • CSS
  • スタイルシートのオブジェクト志向的な書き方ってありますか?

    次のような背景画像部分だけが異なる場合、 .MY_TABLE_1 { position: static; height: 15; color: #ffffff; background-color: #ffffff; background-image: url('bg_title_blue.gif'); font-family: MS UI Gothic; font-weight: normal; font-size: 12; text-indent: 10; border-left: thin groove #cccccc; border-right: thin groove #666666; border-top: thin groove #cccccc; border-bottom: thin groove #666666; padding: 0 } .MY_TABLE_2 { position: static; height: 15; color: #ffffff; background-color: #ffffff; background-image: url('bg_title_yellow.gif'); font-family: MS UI Gothic; font-weight: normal; font-size: 12; text-indent: 10; border-left: thin groove #cccccc; border-right: thin groove #666666; border-top: thin groove #cccccc; border-bottom: thin groove #666666; padding: 0 } これをまとめて、 .MY_TABLE_BASE { position: static; height: 15; color: #000000; background-color: #ffffff; font-family: MS UI Gothic; font-weight: normal; font-size: 12; text-indent: 10; border-left: thin groove #cccccc; border-right: thin groove #666666; border-top: thin groove #cccccc; border-bottom: thin groove #666666; padding: 0 } .MY_TABLE_1 { ほにゃらら background-image: url('bg_title_blue.gif'); } .MY_TABLE_2 { ほにゃらら background-image: url('bg_title_yellow.gif'); } というようにまとめて指定する方法はないのでしょうか???

    • ベストアンサー
    • CSS

専門家に質問してみよう