Question: So for the program I'm writing I have an overview of notes the user created. This I created with `TextBox`es that are generated from database values. I want the user to not be able to enter and change anything in this overview.  

I tried to use `tb.ReadOnly = true;` but this doesn't disable the entering of the textbox.  

After that I tried `tb.Enabled = false;` but this applies a gray out to all the text.

Is there any way to remove this gray out or just make the `TextBox` unchangeable without any visual difference?

Answer: 
Though not the most elegant solution, if you wanted/neded a brute-force base R approach:

```
want <- matrix(NA, ncol = 2, nrow = length(x_steps))
for(xx in seq_along(x_steps)){
  res <- seq(x_steps[xx], x_steps[xx] + 1, 0.0001)
  want[xx,] <- c(x_steps[xx], 
                 max(cumsum(input_data[input_data$x_data %in% res[-length(res)], "y_data"])))
}

```

Output:

```
#>want
#[,1]     [,2]
#[1,]    2 3.308344
#[2,]    3 1.581712
#[3,]    4 2.660372
#[4,]    5 0.899825

```

If the steps are truly lower resolution, an easier `dplyr()` approach may be to use `floor()` then perform some basic functions:

```

input_data %>% 
  group_by(floor(x_data)) %>% 
  mutate(cum_sum = cumsum(y_data)) %>%
  filter(row_number() == n()) %>%
  select(cum_sum)

```

Output:

```
  `floor(x_data)` cum_sum
            <dbl>   <dbl>
1               2   3.31 
2               3   2.47 
3               4   2.76 
4               5   0.900

```
This is what I came up with:

```
x_steps <- seq(2, 5, 1)
final_data <-  tibble(x_steps)
final_data <- final_data  %>% mutate(id=cut(x_steps, breaks=c(-Inf, x_steps), labels=seq(2, 5, 1)))

x_data <- seq(2, 5, 0.2) # this is really read in from a file
y_data <- runif(length(x_data)) # this is really read in from a file
input_data <- tibble(x_data, y_data)

final_data <- input_data %>% 
  mutate(id=cut(x_data, breaks=c(-Inf, x_steps), labels=seq(2, 5, 1))) %>% 
  group_by(id) %>% 
  summarise(totals=sum(y_data)) %>% 
  mutate(csum = cumsum(totals)) %>% 
  select(c("id", "csum")) %>% 
  right_join(final_data, by="id") %>% 
  relocate(x_steps)

```

I stuck with the explicit ID column, as I wanted to join it back to the `final_data` tibble, along with other calculations.

Part my own deductions, part taking from @deschen