public void GoToAddress() { GoToAddress address = new GoToAddress(); address.Address = 0; using (frmGoToLine frm = new frmGoToLine(address, 8)) { frm.StartPosition = FormStartPosition.Manual; Point topLeft = this.PointToScreen(new Point(0, 0)); frm.Location = new Point(topLeft.X + (this.Width - frm.Width) / 2, topLeft.Y + (this.Height - frm.Height) / 2); if (frm.ShowDialog() == DialogResult.OK) { int index = -1; for (int i = 0; i < _counts.Length; i++) { if (_counts[i].Address == address.Address) { index = i; break; } } if (index >= 0) { lstCounters.EnsureVisible(index); lstCounters.SelectedIndices.Clear(); lstCounters.SelectedIndices.Add(index); } } } }
public void GoToAddress() { GoToAddress address = new GoToAddress(); int currentAddr = (int)(this.ctrlHexBox.CurrentLine - 1) * this.ctrlHexBox.BytesPerLine; address.Address = (UInt32)currentAddr; using (frmGoToLine frm = new frmGoToLine(address, (_byteProvider.Length - 1).ToString("X").Length)) { frm.StartPosition = FormStartPosition.Manual; Point topLeft = this.PointToScreen(new Point(0, 0)); frm.Location = new Point(topLeft.X + (this.Width - frm.Width) / 2, topLeft.Y + (this.Height - frm.Height) / 2); if (frm.ShowDialog() == DialogResult.OK) { GoToAddress((int)address.Address); } } }
public void GoToAddress() { GoToAddress address = new GoToAddress(); int currentAddr = (int)(this.ctrlHexBox.CurrentLine - 1) * this.ctrlHexBox.BytesPerLine; address.Address = (UInt32)currentAddr; frmGoToLine frm = new frmGoToLine(address); frm.StartPosition = FormStartPosition.Manual; Point topLeft = this.PointToScreen(new Point(0, 0)); frm.Location = new Point(topLeft.X + (this.Width - frm.Width) / 2, topLeft.Y + (this.Height - frm.Height) / 2); if (frm.ShowDialog() == DialogResult.OK) { this.ctrlHexBox.ScrollByteIntoView((int)address.Address); this.ctrlHexBox.Focus(); } }