var array=new Array(); array[0,0]=0; array[1,0]=1; alert(array[0,0]); alert(array[1,0]);
結論的には、双方ともに1を表示します。
皆さんも気をつけましょう。
謹賀新年
var array=new Array(); array[0,0]=0; array[1,0]=1; alert(array[0,0]); alert(array[1,0]);
int index=1; while(val/=base && ++index<len);
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if(e.ColumnIndex==5) { // If set, the following will be shown in the cell. The Cell's value typed as an int will not be set correctly. //e.Value = "1"; // Instead, directly access the Cell object. int row = e.RowIndex; int col = e.ColumnIndex; dataGridView1.Rows[row].Cells[col].Value = 1; break; } }
comboBox1.DataSource = TimeZoneInfo.GetSystemTimeZones(); comboBox2.DataSource = TimeZoneInfo.GetSystemTimeZones();
System.Collections.ObjectModel.ReadOnlyCollectionlist = TimeZoneInfo.GetSystemTimeZones(); TimeZoneInfo[] tzList = list.ToArray(); comboBox1.Items.AddRange(tzList); comboBox2.Items.AddRange(tzList);
public class InitTest { int test=0; InitTestClass testClass=new InitTestClass(test); public static void main(String args[]) { InitTest test=new InitTest(); } } class InitTestClass { int test=0; InitTestClass(int test) { this.test=test; } }
namespace InitTest { class Program { int test = 0; // Error InitTestClass testClass = new InitTestClass(test); static void Main(string[] args) { } } class InitTestClass { int test = 0; public InitTestClass(int test) { this.test = test; } } }
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); if (e.Index < comboBox1.Items.Count) { e.Graphics.DrawString((string)comboBox1.Items[e.Index], e.Font, Brushes.Black, e.Bounds); if (e.Index < modifiedMessages.Count() && modifiedMessages[e.Index]) { Bitmap bmp = new Bitmap(Properties.Resources.checkMark); int iconWidth = 16; int iconHeight = 16; e.Graphics.DrawImage(bmp, e.Bounds.Right - iconWidth, e.Bounds.Bottom - iconHeight, iconWidth, iconHeight); } } e.DrawFocusRectangle(); }
private void dataGridView1_CellFormatting(object sender , DataGridViewCellFormattingEventArgs e) { if (e.Value == null) { switch (e.ColumnIndex) { case 0: e.Value=dataGridView1.Rows.Count; break; case 1: break; case 2: e.Value = "Instant"; break; case 3: break; case 4: e.Value = "0"; break; case 5: e.Value = "0 sec"; break; } } }
public class NewClassTest { class A { int i=0; A(int i) { this.i=i; } } class B extends A { B() { super(1); } } public void test() { System.out.println(new B().i); } public static void main(String args[]) { new NewClassTest().test(); } }
class Class1 { protected string value = "to be overwritten"; public Class1(string convert) { value = convert; } } class Class2 : Class1 { public Class2(string additional, string convert) : base(convert) { value = convert + additional; } public string value { get; set; } } public partial class Form1 : Form { public Form1() { InitializeComponent(); Class2 test = new Class2(" additional text", "original text"); label1.Text = test.value; } }
using System.Runtime.InteropServices; const int WM_USER = 0x400; const int PBM_SETSTATE = WM_USER + 16; const int PBM_GETSTATE = WM_USER + 17; [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
public enum ProgressBarStateEnum : int { Normal = 1, Error = 2, Paused = 3, } public static void SetState(ProgressBar pBar, ProgressBarStateEnum state) { SendMessage(pBar.Handle, PBM_SETSTATE, (IntPtr)state, IntPtr.Zero); } SetState(progressBar1, ProgressBarStateEnum.Error);
SetState(progressBar1, ProgressBarStateEnum.Normal);
if (progressBar1.Maximum * .9 < len) { progressBar1.Value = 0; SetState(progressBar1, ProgressBarStateEnum.Normal); progressBar1.Value = len; SetState(progressBar1, ProgressBarStateEnum.Error); } else { progressBar1.Value = len; SetState(progressBar1, ProgressBarStateEnum.Normal); }
private const int WM_LBUTTONDOWN = 0x201; private const int WM_NCLBUTTONDBLCLK = 0x00A3; private const int WM_NCLBUTTONDOWN = 0x00A1; public bool PreFilterMessage(ref Message msg) { switch (msg.Msg) { case WM_NCLBUTTONDBLCLK: case WM_NCLBUTTONDOWN: case WM_LBUTTONDOWN: { int lparam = (int)msg.LParam; int x = lparam & 0xffff; int y = lparam >> 16; Simulator simulator = (Simulator)sender; Point pos = simulator.RichTextBox1.PointToClient(new Point(x, y)); Rectangle rect = new Rectangle(0, 0, simulator.RichTextBox1.Bounds.Width , simulator.RichTextBox1.Bounds.Height + SystemInformation.HorizontalScrollBarThumbWidth); if (!rect.Contains(pos)) { simulator.focusOff(); } } break; } return false; }
LocalPrintServer myPrintServer = new LocalPrintServer(); PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues(); string jobList = ""; foreach (PrintQueue pq in myPrintQueues) { if (!pq.IsWaiting) { PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection(); foreach (PrintSystemJobInfo job in jobs) { jobList = jobList + "Job: " + job.JobName + " ID: " + job.JobIdentifier+"\n"; } } }
Qt/C++ のアプリは、外部へ直接アクセスできます。これはネットアプリでは不可能な Qt のメリットです。 外部プログラムを起動することもできます。QProcess::startDetached() を使うと独立したプロセスを立ち上げることができます。 この QProces...